enableviewstate=false, still viewstate information is added

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default enableviewstate=false, still viewstate information is added

    Hi

    Even though the Viewstate has been disabled, ASP.NET
    still uses about twenty bytes for Viewstate.

    Not only can you disable Viewstate at the page level, but
    you can also disable Viewstate at the control level. For
    example, the following code disables Viewstate for a
    ListBox control:


    <asp:listbox EnableViewState="false" id="ListBox1"
    runat="server" Rows="10"></asp:listbox>

    You can also disable Viewstate for the entire application
    in the web.config file:


    <configuration>
    <system.web>
    <pages buffer="true"
    EnableViewState="true" />
    </system.web>
    </configuration>

    HTH
    Ravikanth

    >-----Original Message-----
    >Hello.
    >
    >I'm adding some controls at runtime, and I've set
    enableviewstate=false in
    >my aspx page.
    >Still, it adds viewstate information for my page. This
    seems only to apply
    >when I'm adding a checkboxlist, allthough I'm not sure
    that this is the
    >case. I've even tried setting enableviewstate=false for
    the controls.
    >I really don't need this extra information, and I can't
    understand why it's
    >beeing added, because I've set the viewstate to false..
    >
    >
    >C.H
    >
    >
    >.
    >
    Ravikanth[MVP] Guest

  2. Similar Questions and Discussions

    1. enableviewstate=false cause datagrid to disappear
      For sorting to work we need to enable viewstate for datagrid. But to avoid excessive load on client machine because of viewstate . You can disable...
    2. Using Datagrid with EnableViewState="false" gets wrong DataKeys value
      I have created a datagrid with search text boxes on the page that allow the user to filter the list. If I use view state, as in the Example 1,...
    3. EnableViewState = false not working
      Hi I have a problem which is easily reproducable using VS.NET 2003 and the .Net framework 1.1 (not tested with framework 1.0) regarding disabling...
    4. Newbie question on Viewstate information
      Hi All, I am new to ASP.NET . I have developed an sample application . My problem is that all webpages are very very slow.. and when i see...
    5. Storing page information / viewstate between pages
      Thanks for the reply. Eventually I ended up using a serializable class, which holds the entered data, and is stored in the session when the user...
  3. #2

    Default added enableviewstate=false in web.config - still no luck.

    Hmm...I've added that information to my web.config file, still I get this
    much viewstate information:

    <input type="hidden" name="__VIEWSTATE" value="dDwxMDAzNDU0NTMwOztsPHJlcFF1
    aXpRdWVzdGlvbjpfY3RsMTc6cXVlc3Rpb25fODow
    O3JlcFF1aXpRdWVzdGlvbjpfY3RsMTc6cXVlc3Rpb
    25fODoxO3JlcFF1aXpRdWVzdGlvbjpfY3RsMTc6cX
    Vlc3Rpb25fODoyO3JlcFF1aXpRdWVzdGlvbjpfY3Rs
    MTc6cXVlc3Rpb25fODozO3JlcFF1aXpRdWVzdGlvbj
    pfY3RsMTc6cXVlc3Rpb25fODozO3JlcFF1aXpRdWVz
    dGlvbjpfY3RsMTk6cXVlc3Rpb25fOTowO3JlcFF1aXpR
    dWVzdGlvbjpfY3RsMTk6cXVlc3Rpb25fOToxO3JlcFF1a
    XpRdWVzdGlvbjpfY3RsMTk6cXVlc3Rpb25fOToyO3JlcFF1
    aXpRdWVzdGlvbjpfY3RsMTk6cXVlc3Rpb25fOTozO3JlcFF1
    aXpRdWVzdGlvbjpfY3RsMTk6cXVlc3Rpb25fOTozO3JlcFF1
    aXpRdWVzdGlvbjpfY3RsMjE6cXVlc3Rpb25fMTA6MDtyZX
    BRdWl6UXVlc3Rpb246X2N0bDIxOnF1ZXN0aW9uXzEwOjE
    7cmVwUXVpelF1ZXN0aW9uOl9jdGwyMTpxdWVzdGlvbl8xMD
    oyO3JlcFF1aXpRdWVzdGlvbjpfY3RsMjE6cXVlc3Rpb25fMTA6
    MztyZXBRdWl6UXVlc3Rpb246X2N0bDIxOnF1ZXN0aW9uXzEw
    OjQ7cmVwUXVpelF1ZXN0aW9uOl9jdGwyMTpxdWVzdGlvbl8xM
    Do0Oz4+W/Gaa6CwxccKDvHCVnbf0yLMFJU=" />


    That seems as an awful lot of information! It only happens when I use
    checkboxlist


    Regards C.H


    Christian H Guest

  4. #3

    Default enableviewstate=false, still viewstate information is added

    check the default viewstate settings of these controls
    sultan zahir khan Guest

  5. #4

    Default controls have enableViewState=false, still viewstate info is added

    Well, they are enabled by default, but I've set the enableViewState=false on
    all of my controls.
    This is really a mystery to me..

    CH


    Christian H Guest

  6. #5

    Default Re: controls have enableViewState=false, still viewstate info is added

    You will notice that the viewstate gets smaller as you put controls with
    enableviewstate = false.

    Mind that the page itself also as viewstate.

    Also, if you are not using viewstate whatsoever... perhaps would be better to
    use HTML controls instead of WebControls.

    regards

    Joao Cardoso (MVP dotNET)
    ================================================== =====
    [LusoCoders]- [url]http://groups.yahoo.com/group/lusocoders/[/url]
    [PontoNetPT]- [url]http://www.programando.net/regras.aspx[/url]
    [email]jjscc@acinet.pt.nosp[/email]am - [url]www.acinet.pt[/url]
    ================================================== =====
    Joao S Cardoso [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139