GeekArticles
Database
SQL Server
Database
SQL ServerDetermine Your ASP.NET Page's View State Size
<p>
The ASP.NET WebForms model aims to simplify web development by blurring the line between the client and the server. In short, WebForms allow the page developer to
set aside the fact that the browser and the web server are temporally, physically, and logically disconnected. The page developer can create server-side event handlers that
execute in response to a client-side action (like clicking a button). He can make server-side changes to properties of Web controls on the page and need not worry about
reinstating those properties on the subsequent postback. One of the essential ingredients for performing this magic is <i>view state</i>.
</p><p>
View state represents the state of an ASP.NET web page that is to be remembered across postbacks. On each page visit, an ASP.NET web page automatically constructs this
state information and stores it to a hidden form field on the page named <code>__VIEWSTATE</code>. When the form is submitted, the browser returns this hidden form field
to the server; the ASP.NET page then parses the view state information to reconstruct the state from the previous page visit. This entire process happens automatically
behind the scenes and is, in part, what makes ASP.NET web development so accessible.
</p><p>
Unfortunately, there is no such thing as a free lunch, and view state is no exception. The presence of view state adds to the size of the page, thereby resulting in larger
page sizes that can negatively effect the user experience. more, certain controls - such as DropDownLists and GridViews - can significantly add to the heft of
a view state. a good practice for WebForm developers to keep an eye on their view state sizes to ensure an optimal user experience. This article
two ways to programmatically determine a view state size and to provide a warning should the view state size exceed some specified threshold. Read on to learn more!
<br /><a More ></a></p>
Sponsored Links
Read Next: Using Microsoft's Chart Controls In An ASP.NET Application: Using the Chart Controls with ASP.NET M
Related Topics
Subscribe via RSS
SQL Server
- Naming Database Objects: Part II
- Trace Messages Part V: Trace Cleanup
- Naming Database Objects: Part I
- Multiple-Child Aggregation
- Creating SQL Tables for an Integrating Application Using Dexterity
- SQL Server 2005 Beta 2 Transact-SQL Enhancements
- .NET Rocks! - Brian Larson on SQL Server Reporting Services
- Computing the Trimmed Mean in SQL
- SQL Server 2000 Gains on Oracle
- Separator First Formatting (SFF)
