Manage Your ViewState


Depending on the size of the viewstate, transmitting your viewstate across a network can entail a performance hit. You can check the viewstate for any control on the complete page by enabling tracing using the Page directive:

  <%@ Page Trace="true" ... %>  

To disable viewstate maintenance for a page, use the following Page directive:

  <%@ Page EnableViewState="false" ... %>  

To disable viewstate maintenance for a single control, use the EnableViewState property:

  <ASP:Datagrid EnableViewState="false" ... runat="server"/>  

To disable viewstate maintenance for an entire application, change the setting in web.config :

  <pages enableViewState="false" ... />  



Professional ASP. NET 1.1
Professional ASP.NET MVC 1.0 (Wrox Programmer to Programmer)
ISBN: 0470384611
EAN: 2147483647
Year: 2006
Pages: 243

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net