Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Disable ViewState

Reply
Thread Tools

Disable ViewState

 
 
Julien Grossiord
Guest
Posts: n/a
 
      11-23-2005
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



 
Reply With Quote
 
 
 
 
Bruce Barker
Guest
Posts: n/a
 
      11-23-2005
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)

"Julien Grossiord" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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 2K
>
>
>



 
Reply With Quote
 
 
 
 
emancero emancero is offline
Junior Member
Join Date: Nov 2006
Posts: 1
 
      11-12-2006
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
disable ViewState ? George Ter-Saakov ASP .Net 7 01-20-2007 10:34 PM
Even I disable the ViewState property, I still see the hidden field _VIEWSTATE Umut Tezduyar ASP .Net 4 02-15-2006 08:35 PM
How can I completly disable ViewState? Stan ASP .Net 3 07-01-2004 12:17 PM
cannot disable viewstate on a datagrid Rhodri ASP .Net 1 04-22-2004 05:18 AM
Partially Disable DataList ViewState Homa ASP .Net 2 12-15-2003 08:40 PM



Advertisments