You can turn off viewstate by adding the attribute "EnableViewState" to your page.
<%@ Page language="c#" EnableViewState="false" Inherits="MyAwesomeApp.table" %>
But it didn't work in my page. The value of EnableViewState is overridden by the MasterPage's value.
You can also change "EnableViewState" in web.configs with
<pages enableViewState=“false” />
But depending on which subdirectory the web.config is in, it may be overridden by something else.
The way I finally killed viewstate was by explicitly setting the "EnableViewState" variable on the page:
private void Page_Load(object sender, EventArgs e)
{
this.EnableViewState = false;
...
}
Then it stayed dead.
Hmmm.... hey wait ... is that a heartbeat I'm hearing?
No comments:
Post a Comment