I coworker of mine is having trouble accessing the value of a read-only textbox set via client-side script:
If you are like me you want to use as much client-side power as you can. Part of communicating the results of this power to the ASP.NET code on the server often involves populating an from client script so that you can read the corresponding object on the server. Often, though, we don't want the user to be able to interact with the textbox on the client. If we don't want them to see it then you can set the CSS properties (style= or class= or by a selector in the CSS script block) to hide or not display the textbox. That's easy enough. But what if you want the user to see the textbox but not interact with it? You'd think that setting the enabled attribute on the element would be the thing, right? Well, sure, that looks like it works. The textbox shows and your client-side script can interact with it. What's the catch? None if you initially populate the textbox's text property from the code behind. Then it all is good. But if you start with an empty textbox, populate it on the client, and then attempt to read the value on a postback you will get String.Empty no matter what is actually in the textbox.
Anyone have a reason or a workaround?