HighTechTalks DotNet Forums  

the viewstate hidden field, how can I reduce it?

ASP.net ASP.net discussions (microsoft.public.dotnet.framework.aspnet)


Discuss the viewstate hidden field, how can I reduce it? in the ASP.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Jeff
 
Posts: n/a

Default the viewstate hidden field, how can I reduce it? - 04-08-2010 , 04:11 AM






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+zjv6ptIUmMgYaq KCBB/5hAKJ748W52U1l74GfNLHDuTLuwC/O4GQE/Sp+BnQYsW+nJHK+Qkg6xfb467kHRpiCUUl/Uv2tgQssSa2K4sfbMyaL/IIlb03091A3lbQV1wLMDvL7NPqXgwJERA1+Cx2eNlzll2WkbhN Qw5Ne0FmtmBXaZysPeDEeQIrl5R2IesEHnCbrG5Mz2otNviv2J Kia1yXgAKw3ljDlH7wmYWOF+WXn9lhsF5YElQnMZV2hpzQjJ91 O5YARub/ci77gftNaI2Z6FqHjHve8Yai83aUS/RvXBK/MuDAr0x5QzCldkzBQyqv4FwbUqkP+e5F7Oo/307JM0mj6aBKZHmGzN4bT5cE/G/rOkNP7OrXrL0L/ht8yDOd43WyBuHIxYM3LNKSYimoNnaYKaXFBEmubIsoxpM/gxrEPNonVUozExBOTWIomfAQc5Z8zyeyphehA4iv9GVloZQhEZ WPa29kvwvw1TqXpn9SySEFNikJWyCzTn1CcN8L33zAFJl3NOLW 08yHtEG8r0NgDSE1I3ks0/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?

Reply With Quote
  #2  
Old   
Mr. Arnold
 
Posts: n/a

Default Re: the viewstate hidden field, how can I reduce it? - 04-08-2010 , 06:45 AM






Jeff wrote:
Quote:
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+zjv6ptIUmMgYaq KCBB/5hAKJ748W52U1l74GfNLHDuTLuwC/O4GQE/Sp+BnQYsW+nJHK+Qkg6xfb467kHRpiCUUl/Uv2tgQssSa2K4sfbMyaL/IIlb03091A3lbQV1wLMDvL7NPqXgwJERA1+Cx2eNlzll2WkbhN Qw5Ne0FmtmBXaZysPeDEeQIrl5R2IesEHnCbrG5Mz2otNviv2J Kia1yXgAKw3ljDlH7wmYWOF+WXn9lhsF5YElQnMZV2hpzQjJ91 O5YARub/ci77gftNaI2Z6FqHjHve8Yai83aUS/RvXBK/MuDAr0x5QzCldkzBQyqv4FwbUqkP+e5F7Oo/307JM0mj6aBKZHmGzN4bT5cE/G/rOkNP7OrXrL0L/ht8yDOd43WyBuHIxYM3LNKSYimoNnaYKaXFBEmubIsoxpM/gxrEPNonVUozExBOTWIomfAQc5Z8zyeyphehA4iv9GVloZQhEZ WPa29kvwvw1TqXpn9SySEFNikJWyCzTn1CcN8L33zAFJl3NOLW 08yHtEG8r0NgDSE1I3ks0/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.

Reply With Quote
  #3  
Old   
Jason Keats
 
Posts: n/a

Default Re: the viewstate hidden field, how can I reduce it? - 04-08-2010 , 07:23 AM



Jeff wrote:
Quote:
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+zjv6ptIUmMgYaq KCBB/5hAKJ748W52U1l74GfNLHDuTLuwC/O4GQE/Sp+BnQYsW+nJHK+Qkg6xfb467kHRpiCUUl/Uv2tgQssSa2K4sfbMyaL/IIlb03091A3lbQV1wLMDvL7NPqXgwJERA1+Cx2eNlzll2WkbhN Qw5Ne0FmtmBXaZysPeDEeQIrl5R2IesEHnCbrG5Mz2otNviv2J Kia1yXgAKw3ljDlH7wmYWOF+WXn9lhsF5YElQnMZV2hpzQjJ91 O5YARub/ci77gftNaI2Z6FqHjHve8Yai83aUS/RvXBK/MuDAr0x5QzCldkzBQyqv4FwbUqkP+e5F7Oo/307JM0mj6aBKZHmGzN4bT5cE/G/rOkNP7OrXrL0L/ht8yDOd43WyBuHIxYM3LNKSYimoNnaYKaXFBEmubIsoxpM/gxrEPNonVUozExBOTWIomfAQc5Z8zyeyphehA4iv9GVloZQhEZ WPa29kvwvw1TqXpn9SySEFNikJWyCzTn1CcN8L33zAFJl3NOLW 08yHtEG8r0NgDSE1I3ks0/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

Reply With Quote
  #4  
Old   
Jeff
 
Posts: n/a

Default Re: the viewstate hidden field, how can I reduce it? - 04-08-2010 , 07:57 AM



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" <jkeats (AT) melbpcDeleteThis (DOT) org.au> wrote

Quote:
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+zjv6ptIUmMgYaq KCBB/5hAKJ748W52U1l74GfNLHDuTLuwC/O4GQE/Sp+BnQYsW+nJHK+Qkg6xfb467kHRpiCUUl/Uv2tgQssSa2K4sfbMyaL/IIlb03091A3lbQV1wLMDvL7NPqXgwJERA1+Cx2eNlzll2WkbhN Qw5Ne0FmtmBXaZysPeDEeQIrl5R2IesEHnCbrG5Mz2otNviv2J Kia1yXgAKw3ljDlH7wmYWOF+WXn9lhsF5YElQnMZV2hpzQjJ91 O5YARub/ci77gftNaI2Z6FqHjHve8Yai83aUS/RvXBK/MuDAr0x5QzCldkzBQyqv4FwbUqkP+e5F7Oo/307JM0mj6aBKZHmGzN4bT5cE/G/rOkNP7OrXrL0L/ht8yDOd43WyBuHIxYM3LNKSYimoNnaYKaXFBEmubIsoxpM/gxrEPNonVUozExBOTWIomfAQc5Z8zyeyphehA4iv9GVloZQhEZ WPa29kvwvw1TqXpn9SySEFNikJWyCzTn1CcN8L33zAFJl3NOLW 08yHtEG8r0NgDSE1I3ks0/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

Reply With Quote
  #5  
Old   
Mr. Arnold
 
Posts: n/a

Default Re: the viewstate hidden field, how can I reduce it? - 04-08-2010 , 10:02 AM



Jeff wrote:
Quote:
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.

Reply With Quote
  #6  
Old   
Jeff
 
Posts: n/a

Default Re: the viewstate hidden field, how can I reduce it? - 04-08-2010 , 11:56 AM



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" <Arnold (AT) Arnold (DOT) com> wrote

Quote:
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.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.