|
-
Jul 3rd, 2005, 10:11 PM
#1
Thread Starter
Frenzied Member
Can't seem to disable ViewState
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.
-
Jul 4th, 2005, 08:56 AM
#2
Re: Can't seem to disable ViewState
Elaborate on what you mean by "ViewState keeps showing up in the web page"
-
Jul 4th, 2005, 01:34 PM
#3
Thread Starter
Frenzied Member
Re: Can't seem to disable ViewState
If you look at the page source, you still see a hidden field called "__ViewState"...
-
Jul 4th, 2005, 11:47 PM
#4
Re: Can't seem to disable ViewState
Yes but how does this manifest itself in your page and/or pose a problem?
-
Jul 5th, 2005, 12:22 AM
#5
Thread Starter
Frenzied Member
Re: Can't seem to disable ViewState
 Originally Posted by mendhak
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?
-
Jul 5th, 2005, 12:43 AM
#6
Re: Can't seem to disable ViewState
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
-
Jul 7th, 2005, 01:11 PM
#7
Frenzied Member
Re: Can't seem to disable ViewState
 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;
Magiaus
If I helped give me some points.
-
Jul 8th, 2005, 07:17 AM
#8
Re: Can't seem to disable ViewState
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|