Seems like no matter what I do, I can't disable ViewState. I have placed the correct directive at both the page level and web.config level, but ViewState keeps showing up in the web page.
Any help on this would be appreciated.
Printable View
Seems like no matter what I do, I can't disable ViewState. I have placed the correct directive at both the page level and web.config level, but ViewState keeps showing up in the web page.
Any help on this would be appreciated.
Elaborate on what you mean by "ViewState keeps showing up in the web page"
If you look at the page source, you still see a hidden field called "__ViewState"...
Yes but how does this manifest itself in your page and/or pose a problem?
It manifests itself in my page because it is in my page. The problem is that I don't want ViewState and don't need it. Isn't it optional?? So why can't I seem to turn it off?Quote:
Originally Posted by mendhak
The hash value comes up anyways. You need to override a couple methods to disable it almost completely. Place this in your page's codebehind:
VB Code:
Protected Overrides Sub SavePageStateToPersistenceMedium(ByVal viewState As Object) End Sub Protected Overrides Function LoadPageStateFromPersistenceMedium() As Object Return Nothing End Function Protected Overrides Function SaveViewState() As Object Return Nothing End Function
I wanted to say that.... or Page.EnableViewState = false;Quote:
Originally Posted by mendhak
I'm assuming he did that already, but I think he had a problem with the small hashstring that shows up in the html source anyways.