Professional ASP.NET 1.1 [Electronic resources]

Alex Homeret

نسخه متنی -صفحه : 243/ 197
نمايش فراداده

l xmlns="http://www.w3.org/1999/l">

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