the viewstate hidden field, how can I reduce it?

Discussion in 'ASP .Net' started by Jeff, Apr 8, 2010.

  1. Jeff

    Jeff Guest

    hi

    asp.net 3.5

    I see in my page that the hidden field viewstate is relativly very large,
    and are looking for ways to reduce it. Because I think it can improve
    ranking.

    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
    value="WJ6eLjF5Grnr80+KngeZIcTDmEbX+zjv6ptIUmMgYaqKCBB/5hAKJ748W52U1l74GfNLHDuTLuwC/O4GQE/Sp+BnQYsW+nJHK+Qkg6xfb467kHRpiCUUl/Uv2tgQssSa2K4sfbMyaL/IIlb03091A3lbQV1wLMDvL7NPqXgwJERA1+Cx2eNlzll2WkbhNQw5Ne0FmtmBXaZysPeDEeQIrl5R2IesEHnCbrG5Mz2otNviv2JKia1yXgAKw3ljDlH7wmYWOF+WXn9lhsF5YElQnMZV2hpzQjJ91O5YARub/ci77gftNaI2Z6FqHjHve8Yai83aUS/RvXBK/MuDAr0x5QzCldkzBQyqv4FwbUqkP+e5F7Oo/307JM0mj6aBKZHmGzN4bT5cE/G/rOkNP7OrXrL0L/ht8yDOd43WyBuHIxYM3LNKSYimoNnaYKaXFBEmubIsoxpM/gxrEPNonVUozExBOTWIomfAQc5Z8zyeyphehA4iv9GVloZQhEZWPa29kvwvw1TqXpn9SySEFNikJWyCzTn1CcN8L33zAFJl3NOLW08yHtEG8r0NgDSE1I3ks0/AIzEIMCpgMfcsWytxwQ=="
    />
    </div>

    I've already set enableviewstate to false in the master page. This page
    (deafult.apsx) has a 3 custom controls: one is control holding the login
    control etc. The 2 other controls are based on gridview and loginview

    any suggestions?
     
    Jeff, Apr 8, 2010
    #1
    1. Advertising

  2. Jeff

    Mr. Arnold Guest

    Jeff wrote:
    > hi
    >
    > asp.net 3.5
    >
    > I see in my page that the hidden field viewstate is relativly very large,
    > and are looking for ways to reduce it. Because I think it can improve
    > ranking.
    >
    > <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
    > value="WJ6eLjF5Grnr80+KngeZIcTDmEbX+zjv6ptIUmMgYaqKCBB/5hAKJ748W52U1l74GfNLHDuTLuwC/O4GQE/Sp+BnQYsW+nJHK+Qkg6xfb467kHRpiCUUl/Uv2tgQssSa2K4sfbMyaL/IIlb03091A3lbQV1wLMDvL7NPqXgwJERA1+Cx2eNlzll2WkbhNQw5Ne0FmtmBXaZysPeDEeQIrl5R2IesEHnCbrG5Mz2otNviv2JKia1yXgAKw3ljDlH7wmYWOF+WXn9lhsF5YElQnMZV2hpzQjJ91O5YARub/ci77gftNaI2Z6FqHjHve8Yai83aUS/RvXBK/MuDAr0x5QzCldkzBQyqv4FwbUqkP+e5F7Oo/307JM0mj6aBKZHmGzN4bT5cE/G/rOkNP7OrXrL0L/ht8yDOd43WyBuHIxYM3LNKSYimoNnaYKaXFBEmubIsoxpM/gxrEPNonVUozExBOTWIomfAQc5Z8zyeyphehA4iv9GVloZQhEZWPa29kvwvw1TqXpn9SySEFNikJWyCzTn1CcN8L33zAFJl3NOLW08yHtEG8r0NgDSE1I3ks0/AIzEIMCpgMfcsWytxwQ=="
    > />
    > </div>
    >
    > I've already set enableviewstate to false in the master page. This page
    > (deafult.apsx) has a 3 custom controls: one is control holding the login
    > control etc. The 2 other controls are based on gridview and loginview
    >
    > any suggestions?
    >
    >


    You keep the data in session variables, load the controls from the
    session variables, and disable viewstate on the controls.

    I don't know what you mean about ranking, but disabling viewstate is
    about not transmitting data for a control on the round trip, which
    speeds up transmition time of the page.
     
    Mr. Arnold, Apr 8, 2010
    #2
    1. Advertising

  3. Jeff

    Jason Keats Guest

    Jeff wrote:
    > hi
    >
    > asp.net 3.5
    >
    > I see in my page that the hidden field viewstate is relativly very large,
    > and are looking for ways to reduce it. Because I think it can improve
    > ranking.
    >
    > <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
    > value="WJ6eLjF5Grnr80+KngeZIcTDmEbX+zjv6ptIUmMgYaqKCBB/5hAKJ748W52U1l74GfNLHDuTLuwC/O4GQE/Sp+BnQYsW+nJHK+Qkg6xfb467kHRpiCUUl/Uv2tgQssSa2K4sfbMyaL/IIlb03091A3lbQV1wLMDvL7NPqXgwJERA1+Cx2eNlzll2WkbhNQw5Ne0FmtmBXaZysPeDEeQIrl5R2IesEHnCbrG5Mz2otNviv2JKia1yXgAKw3ljDlH7wmYWOF+WXn9lhsF5YElQnMZV2hpzQjJ91O5YARub/ci77gftNaI2Z6FqHjHve8Yai83aUS/RvXBK/MuDAr0x5QzCldkzBQyqv4FwbUqkP+e5F7Oo/307JM0mj6aBKZHmGzN4bT5cE/G/rOkNP7OrXrL0L/ht8yDOd43WyBuHIxYM3LNKSYimoNnaYKaXFBEmubIsoxpM/gxrEPNonVUozExBOTWIomfAQc5Z8zyeyphehA4iv9GVloZQhEZWPa29kvwvw1TqXpn9SySEFNikJWyCzTn1CcN8L33zAFJl3NOLW08yHtEG8r0NgDSE1I3ks0/AIzEIMCpgMfcsWytxwQ=="
    > />
    > </div>
    >
    > I've already set enableviewstate to false in the master page. This page
    > (deafult.apsx) has a 3 custom controls: one is control holding the login
    > control etc. The 2 other controls are based on gridview and loginview
    >
    > any suggestions?
    >
    >


    You can store viewstate on the server - for instance, in a database.

    Here's a few search results, in no particular order...

    http://forums.asp.net/p/1293397/2504654.aspx

    http://geekswithblogs.net/joelross/archive/2006/03/23/73180.aspx

    http://www.componentworkshop.com/blog/2009/06/27/advanced-net-storing-viewstate-in-a-database

    http://www.codeproject.com/KB/viewstate/ViewStateProvider.aspx

    http://weblogs.asp.net/adweigert/archive/2004/03/09/86628.aspx

    http://highoncoding.com/Articles/699_Storing_ViewState_in_MongoDb_Database.aspx

    HTH
     
    Jason Keats, Apr 8, 2010
    #3
  4. Jeff

    Jeff Guest

    how do I disable viewstate? I've already set enableviewstate to false in the
    master page and on the 3 custom controls. Depsite that I see the hidden
    field viewstate in the source containing over 600 characters.

    "Jason Keats" <> wrote in message
    news:...
    > Jeff wrote:
    >> hi
    >>
    >> asp.net 3.5
    >>
    >> I see in my page that the hidden field viewstate is relativly very large,
    >> and are looking for ways to reduce it. Because I think it can improve
    >> ranking.
    >>
    >> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
    >> value="WJ6eLjF5Grnr80+KngeZIcTDmEbX+zjv6ptIUmMgYaqKCBB/5hAKJ748W52U1l74GfNLHDuTLuwC/O4GQE/Sp+BnQYsW+nJHK+Qkg6xfb467kHRpiCUUl/Uv2tgQssSa2K4sfbMyaL/IIlb03091A3lbQV1wLMDvL7NPqXgwJERA1+Cx2eNlzll2WkbhNQw5Ne0FmtmBXaZysPeDEeQIrl5R2IesEHnCbrG5Mz2otNviv2JKia1yXgAKw3ljDlH7wmYWOF+WXn9lhsF5YElQnMZV2hpzQjJ91O5YARub/ci77gftNaI2Z6FqHjHve8Yai83aUS/RvXBK/MuDAr0x5QzCldkzBQyqv4FwbUqkP+e5F7Oo/307JM0mj6aBKZHmGzN4bT5cE/G/rOkNP7OrXrL0L/ht8yDOd43WyBuHIxYM3LNKSYimoNnaYKaXFBEmubIsoxpM/gxrEPNonVUozExBOTWIomfAQc5Z8zyeyphehA4iv9GVloZQhEZWPa29kvwvw1TqXpn9SySEFNikJWyCzTn1CcN8L33zAFJl3NOLW08yHtEG8r0NgDSE1I3ks0/AIzEIMCpgMfcsWytxwQ=="
    >> />
    >> </div>
    >>
    >> I've already set enableviewstate to false in the master page. This page
    >> (deafult.apsx) has a 3 custom controls: one is control holding the login
    >> control etc. The 2 other controls are based on gridview and loginview
    >>
    >> any suggestions?
    >>
    >>

    >
    > You can store viewstate on the server - for instance, in a database.
    >
    > Here's a few search results, in no particular order...
    >
    > http://forums.asp.net/p/1293397/2504654.aspx
    >
    > http://geekswithblogs.net/joelross/archive/2006/03/23/73180.aspx
    >
    > http://www.componentworkshop.com/blog/2009/06/27/advanced-net-storing-viewstate-in-a-database
    >
    > http://www.codeproject.com/KB/viewstate/ViewStateProvider.aspx
    >
    > http://weblogs.asp.net/adweigert/archive/2004/03/09/86628.aspx
    >
    > http://highoncoding.com/Articles/699_Storing_ViewState_in_MongoDb_Database.aspx
    >
    > HTH
     
    Jeff, Apr 8, 2010
    #4
  5. Jeff

    Mr. Arnold Guest

    Jeff wrote:
    > how do I disable viewstate? I've already set enableviewstate to false in the
    > master page and on the 3 custom controls. Depsite that I see the hidden
    > field viewstate in the source containing over 600 characters.



    Just because something was done on a master page does that mean that it
    applies to all pages.
     
    Mr. Arnold, Apr 8, 2010
    #5
  6. Jeff

    Jeff Guest

    I applied the enableviewstate="false" to the page as well but still get that
    hidden viewstate field

    I know it's part of the asp.net design and cannot be completely removed from
    the pages. But hope it's possible to reduce it from about 600 chars to under
    100.....




    "Mr. Arnold" <> wrote in message
    news:%...
    > Jeff wrote:
    >> how do I disable viewstate? I've already set enableviewstate to false in
    >> the master page and on the 3 custom controls. Depsite that I see the
    >> hidden field viewstate in the source containing over 600 characters.

    >
    >
    > Just because something was done on a master page does that mean that it
    > applies to all pages.
     
    Jeff, Apr 8, 2010
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alan Silver
    Replies:
    12
    Views:
    8,760
    Alan Silver
    Jun 30, 2005
  2. Umut Tezduyar
    Replies:
    4
    Views:
    3,392
    Ravi Ambros Wallau
    Feb 15, 2006
  3. Stimp
    Replies:
    3
    Views:
    2,799
    Scott M.
    Sep 10, 2006
  4. Rick
    Replies:
    3
    Views:
    8,580
    Alexey Smirnov
    Apr 13, 2010
  5. GavMc
    Replies:
    4
    Views:
    376
    Evertjan.
    Sep 22, 2005
Loading...

Share This Page