Disabling ViewState Throughout

G

Guest

I want to disable ViewState for all pages associated with a given MasterPage.
How do I do this? I've tried doing...

<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="StdMaster.master.cs"
EnableViewState="false"
Inherits="StdMaster" %>

but I still see ViewState hidden tages in my pages
 
K

Karl Seguin

Even if you set it to false, a viewstate control will be added if your page
has a server side form (ie, <form runat="server">). To be honnest, I'm not
sure why that is and what information is added to the viewstate, i just know
it's true :)

The page's SavePageStateToPersistenceMedium and
LoadPageStateFromPersistenceMedium methods might be the only way you have to
completely eliminate the viewstate...

Karl
 
J

Joe (MCAD)

Karl said:
Even if you set it to false, a viewstate control will be added if your
page has a server side form (ie, <form runat="server">). To be honnest,
I'm not sure why that is and what information is added to the viewstate,
i just know it's true :)

The page's SavePageStateToPersistenceMedium and
LoadPageStateFromPersistenceMedium methods might be the only way you
have to completely eliminate the viewstate...

Karl

The only way I know is to use a httphandler and remove it from the
output, easy to do if your rendering xhtml. This is one of those
annoying .net things that would be easy to change if we could change the
framework source code and compile it as needed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top