Disable ViewState

J

Julien Grossiord

Hello,

As I do not need it, I would like to disable ViewState on my server but even
if I use <pages enableViewState="false"> in web.config or <%@ Page EnableViewState="false"
.... %> in my pages, I still have a hidden field __VIEWSTATE in the form.

Do you know how I could disable it ?

Best regards,
Julien.

NB : I use .Net 1.1 on Win 2
 
B

Bruce Barker

there is no way to remove viewstate, its used by the .net infrastrure. you
can turn off controls also using it. if you don't need postback support
(IsPostBack and auto loading of postback data into the controls) you can
strip viewstate by providing your own IStateManager.


-- bruce (sqlwork.com)
 
Joined
Nov 12, 2006
Messages
1
Reaction score
0
delete runat="server" from form1

If you are not using asp.net webcontrols that are usually part of a form like textboxes, buttons, etc.. You can delete runat="server" from the asp.net main form, generally the "form1" form, this way the hidden __VIEWSTATE field won't be rendered.

I have found a situation where you wouldn't want this control rendered: some mail spam detection programs try to make strange changes to hidden fields, so if you e-mail an asp.net generated page, chances are some mail scanner will distort it.
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top