user31673
user31673

Reputation: 13685

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.

Upvotes: 2

Views: 2637

Answers (1)

Related Questions