I ran into an interesting situation today. From what I read it an old issue as well. In ASP.Net 2.0 if you set EnableViewState equal to false and assign a text box as read only the value will be lost on post back.
Rick Strahl posted a nice article on this back in late 2005 which helped me get around this issue.
2005? What? Okay I have to admit that until today I have not been developing my web applications with view state turned completely off. I have turn individual controls on and off as performance required but view state has never been a real issue for me. Today I decided to bite the bullet and just get used to having view state off and it took less than an hour to run into this so here is how to get around it. Yeah I know you probably already know but on the off chance you don’t…then here it is.
Just place the following code in the Page_Load method.
TextBox1.Text = Request[TextBox1.UniqueID];
Popularity: 15% [?]

Recent Comments