1

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

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.