开发者

ASP.NET Viewstate won't disable

I have an ASP.NET 4.0 Web Site (not a Web Application). In a page I have a GridView which I want to disable ViewState. However, I set ViewStateMode="Disabled" on the GridView. That still was showing a very large ViewState when I looked at 开发者_运维技巧"View Source" on the page when running. Then I additionaly set enableviewstate="False" in the master page for the form element. Reran and still the View Source shows a large view state. Then I added this.EnableViewState = false; in the pages Page_Init event handler (with adding the event handler to the constructor of the page). Reran the page and it still shows a large view state. What do I need to do to eliminate a very large viewstate in the generated page sent to the user

   <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="8bYImI .......

I have stopped and started the IIS 7 Web Server.

I am not manually storing any data in cache. This is a simple page that only contains a GridView and some hyperlinks.


See other post in SO (Mentioned below) for the same issue

ViewStateMode Disabled but still getting ViewState element

Gridview ControlState very large even when viewstate disabled and not using DataKeyNames

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜