Quote:
|
Yes HTML will always send back *only* the value= of an <option>. So ASP.NET "connects" those value= values to the text using this __VIEWSTATE info.
|
I don't think that's accurate, is it? Doesn't it know the value and the text because it recreates the control tree at the server and gets a selected value from the client?
ASP.NET does use ViewState for similar stuff though, like the text in a TextBox before it gets sent to the browser. That way, when users enter a different text, the TextChanged event can be fired. ViewState is also used heavily by the data controls to store data, primary keys and so on.
In the book you'll find a number of tips on minimizing the impact of ViewState by turning it off where possible. ASP.NET 4 has greatly changed the ability to fine-tune this (and thus minimize it even further) with the introduction of the ViewStateMode attribute:
http://www.mostlylucid.net/archive/2009/01/28/1312.aspx
Cheers,
Imar