Disabling ViewState in web.config

Software

Starting a new web project, I always disable viewstate by default. If I need it later, I’ll enable it on a page-by-page basis.

To do this in web.config:

<pages enableViewState="false">
...
</pages>

This IS case-sensitive. Not sure why.

Technorati Tags:

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Furl
  • Ma.gnolia
  • Reddit
  • TwitThis
5 Comments

5 Comments

  1. Mark J. Miller  •  Sep 6, 2008 @7:23 am

    The reason it is case-sensitive is because Xml is case-sensitive.

  2. utkarsh  •  Jul 8, 2009 @1:12 pm

    can u elaborate on the statement made above?? regarding y is it case sensitive

  3. LSP  •  Aug 11, 2009 @3:25 pm

    this does not work. check your facts.

  4. anthonyrstevens  •  Aug 11, 2009 @4:26 pm

    LSP: under what circumstances does it not work?

  5. Shankar Kulkarni  •  Dec 9, 2009 @5:26 pm

    If there is a form tag in the master page, disabling the viewstate at page or webconfig, will still create hidden view state variable. VS2k8 creates form tag by default for master pages.

Leave a Reply

Allowed tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">