ASP.NET: Compress ViewState

前端 未结 8 939
礼貌的吻别
礼貌的吻别 2021-02-06 00:27

What are the latest and greatest ways to compress the ASP.NET ViewState content?

What about the performance of this? Is it worth it to keep the pages quick and minimize

8条回答
  •  北荒
    北荒 (楼主)
    2021-02-06 01:04

    The best way to minimize the view state is just to not use it. It will cause you to do some extra work programming (repopulating control values etc on post back, but it will save you on the amount of information you send to the browser). You can't tamper with it.

    Here is a link to the view state on MSDN:

    http://msdn.microsoft.com/en-us/library/ms972976.aspx

    Here is a link describing some best practices:

    http://mnairooz.blogspot.com/2007/01/aspnet-20-viewstate-and-good-practices.html

    And One on disabling the ViewState:

    http://www.codeproject.com/KB/aspnet/ASPNET_Best_Practices.aspx

提交回复
热议问题