views:

27

answers:

2

hi

iam into problem of reading the value of the control which i alterd using javascript the sequence goes like this i got the text box control by using its id cleared the value of the text box make the control disabled.

when i tried to retrive the value of the textbox in aspx.cs iam still getting the old value of the text box which i actualy cleared in the javascript

kindly suggest me to over come this issue

Thanks

A: 

With ASP.NET Web Forms, IDs for elements get assigned automatically by the Page on the server side. It is tricky, but possible, to manipulate element values using javascript. One way to avoid this would be to use ASP.NET MVC where the HTML would be rendered as is and javascript or jquery can be easily used to "play" with the HTML elements. We need more information to help you with the details of your request.

Ralph Stevens
+1  A: 

Disabled input controls don't get their values posted back so ASP.Net doesn't know you changed the value. You need to enable the control.

AUSteve
thanks of the update i made a work around by useing a hidden control to asign the value and taken the value from the hidden control
muthu