Professional ASP.NET MVC 1.0 (Wrox Programmer to Programmer)

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" ... />

Категории