Tech Tutorials Database
GeekArticles Database SQL Server
 

Managing View State in ASP.NET 4 Using the New ViewStateMode Property

 
Author: 4guysfromrolla.com
Category: SQL Server
Comments (0)

<p> The ASP.NET Web Forms model strives to encapsulate the lower level complexities involved in building a web application. Features like server-side event handlers, the page lifecycle, and <a state</a> effectively blur the line between the client and the server, simplify state management, and free the developer from worrying about requests and responses, and similar matters. While these facets of the Web Forms model allow for rapid application development and make ASP.NET more accessible to developers with a web application background, their behavior can impact your behavior and performance. </p><p> View state is perhaps the most important - yet most misunderstood - feature of the Web Forms model. In a nutshell, view state is a technique that automatically persists programmatic changes to the Web controls on a page. By default, this state is serialized into a base-64 encoded string and included as a hidden <code>&lt;input&gt;</code> field in the Web Form. On postback, this state information is returned to the server as part of the POST request, at which point the server can deserialize it and reapply the persisted state to the controls in the control hierarchy. (If this last paragraph made crystal clear sense, great! If not, consider reading my article, <a ASP.NET View State</a>, and <a <a in ASP.NET 4</a>, before continuing.) </p><p> One potential issue with view state is that it can greatly bloat the size of your web pages. Each new version of ASP.NET seems to include new techniques for managing view footprint. ASP.NET 4 adds a new property to all Web controls, <a which allows developers to disable view state for a page by default and then selectively enable it for specific controls. This article reviews existing view state-related properties and then delves into the new <code>ViewStateMode</code> property. Read on to learn more! <br /><a More &gt;</a></p>

Read More...




Sponsored Links




Read Next: Filtering Data Using ASP.NET 4's QueryExtender Control



 

 

Comments



Post Your Comment:

Your Name:*
e-mail ID:(required for notification)*
Image Verification: 
 
 Subscribe