Content deleted Content added
→Microsoft promotion?: Simple solution. |
→Information about ViewState incorrect: new section |
||
Line 255:
The article refers to "clean code" without a link. Quotation marks are around "clean", but not "code". If this is a reference to [[Robert C Martin]]'s concept of clean code, I recommend extending the quotation marks to surround both words, and making that a link, either to an article on clean code, or at least to the one on Martin. [[User:Unfree|Unfree]] ([[User talk:Unfree|talk]]) 16:01, 4 November 2009 (UTC)
== Information about ViewState incorrect ==
The viewstate does not track form values, it's a source of confusion amongs a lot of ASP.NET programmers.
Form values are already sent with the postback data, so these don't have to be in the viewstate. See:
* http://msdn.microsoft.com/en-us/library/ms972976.aspx
* http://weblogs.asp.net/infinitiesloop/archive/2006/08/03/Truly-Understanding-Viewstate.aspx
Viewstate only has to contain the state which changed from the defaults set in the ASCX files and OnInit() method. That includes:
* modifications by a event handler (e.g. showing an panel after a OnClick event -> the Visibility has to be tracked and restored)
* modifications by the `Page_Load()` event.
As critism to Microsoft, this behaviour is IMHO not communicated clearly.
Programmers fill the default Page_Load() method, and end up with a huge ViewState.
This state is transmitted back and forth with every page request, causing performance issues.
[[User:Vdboor|Vdboor]] ([[User talk:Vdboor|talk]]) 09:42, 10 December 2009 (UTC)
|