Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - HUGE Viewstate

 
Thread Tools Search this Thread
Old 11-30-2005, 11:28 AM   #1
Default HUGE Viewstate


It's not unusual (to be lo....cough) for me to have VIEWSTATE ranging from 1
full page to several pages.....

This seems in-efficient - any ideas how to reduce the thing?

Thanks
Kev




Mantorok
  Reply With Quote
Old 11-30-2005, 11:48 AM   #2
Jéjé
 
Posts: n/a
Default Re: HUGE Viewstate
deactivate the enableviewstate option for the controls where you don't have
to store the state.
for example, a menu, a simple list without any sort/select option authorized
(no need to keep information during a postback). deactivating the viewstate
for these controls reduce the size of the page.

Lookat the http://localhost/folder/trace.axd file to identify which controls
produce your viewstate.

if you use .Net Framework 2.0, deactivating the viewstate for a grid keep
the sort/select commands, while in 1.1 the entire state for the grid must be
saved in the viewstate. (same thing for most of the controls in the v2.0)

There is more options, likestoring the viewstate on the server side,
applying some code to store only the requiered information in the state (but
you have to repopulate your controls) etc...

"Mantorok" <> wrote in message
news:dmk2bk$33u$...
> It's not unusual (to be lo....cough) for me to have VIEWSTATE ranging from
> 1 full page to several pages.....
>
> This seems in-efficient - any ideas how to reduce the thing?
>
> Thanks
> Kev
>





Jéjé
  Reply With Quote
Old 11-30-2005, 01:10 PM   #3
Thomas Skovsende
 
Posts: n/a
Default Re: HUGE Viewstate
Mantorok wrote:
> It's not unusual (to be lo....cough) for me to have VIEWSTATE ranging from 1
> full page to several pages.....
>
> This seems in-efficient - any ideas how to reduce the thing?


Jéjé came with a good suggestion...

Another one: if you REALLY need the viewstate, google a bit on "flesk
viewstate", which saves viewstate on the server and only sends an id to
the client.

And why this isnt possible to do without 3rd party libs is beyond me

Best regards,
Thomas Skovsende


Thomas Skovsende
  Reply With Quote
Old 11-30-2005, 01:13 PM   #4
Mantorok
 
Posts: n/a
Default Re: HUGE Viewstate
Thanks for the advice, do you think a large viewstate is a particularly bad
idea?

Thanks
Kev

"Jéjé" <> wrote in message
news:...
> deactivate the enableviewstate option for the controls where you don't
> have to store the state.
> for example, a menu, a simple list without any sort/select option
> authorized (no need to keep information during a postback). deactivating
> the viewstate for these controls reduce the size of the page.
>
> Lookat the http://localhost/folder/trace.axd file to identify which
> controls produce your viewstate.
>
> if you use .Net Framework 2.0, deactivating the viewstate for a grid keep
> the sort/select commands, while in 1.1 the entire state for the grid must
> be saved in the viewstate. (same thing for most of the controls in the
> v2.0)
>
> There is more options, likestoring the viewstate on the server side,
> applying some code to store only the requiered information in the state
> (but you have to repopulate your controls) etc...
>
> "Mantorok" <> wrote in message
> news:dmk2bk$33u$...
>> It's not unusual (to be lo....cough) for me to have VIEWSTATE ranging
>> from 1 full page to several pages.....
>>
>> This seems in-efficient - any ideas how to reduce the thing?
>>
>> Thanks
>> Kev
>>

>
>





Mantorok
  Reply With Quote
Old 11-30-2005, 03:26 PM   #5
Jéjé
 
Posts: n/a
Default Re: HUGE Viewstate
it could be good for intranet usage and for complex form with edition
capability.
So for pages which are less used then navigation pages which are accessed by
more users more frequently.

remember that a large viewstate impact the bandwidth, and if there is a
postback, the viewstate is sent back to the server, so again an impact on
the network.

In the past I have created a complex form with a lot of controls / sub
controls etc.. designed to configure a chart online (the user can change the
colors, axis, values, etc etc...)
This form was really big with a big viewstate, but the user go to this page
only 1 time a month.
In another side, the page which render the chart is really small with a
small viewstate because the page is accessed every day.


"Mantorok" <> wrote in message
news:dmk8fa$6qm$...
> Thanks for the advice, do you think a large viewstate is a particularly
> bad idea?
>
> Thanks
> Kev
>
> "Jéjé" <> wrote in message
> news:...
>> deactivate the enableviewstate option for the controls where you don't
>> have to store the state.
>> for example, a menu, a simple list without any sort/select option
>> authorized (no need to keep information during a postback). deactivating
>> the viewstate for these controls reduce the size of the page.
>>
>> Lookat the http://localhost/folder/trace.axd file to identify which
>> controls produce your viewstate.
>>
>> if you use .Net Framework 2.0, deactivating the viewstate for a grid keep
>> the sort/select commands, while in 1.1 the entire state for the grid must
>> be saved in the viewstate. (same thing for most of the controls in the
>> v2.0)
>>
>> There is more options, likestoring the viewstate on the server side,
>> applying some code to store only the requiered information in the state
>> (but you have to repopulate your controls) etc...
>>
>> "Mantorok" <> wrote in message
>> news:dmk2bk$33u$...
>>> It's not unusual (to be lo....cough) for me to have VIEWSTATE ranging
>>> from 1 full page to several pages.....
>>>
>>> This seems in-efficient - any ideas how to reduce the thing?
>>>
>>> Thanks
>>> Kev
>>>

>>
>>

>
>





Jéjé
  Reply With Quote
Old 11-30-2005, 03:35 PM   #6
Mantorok
 
Posts: n/a
Default Re: HUGE Viewstate
Ok, that makes sense, thanks very much.

Kev

"Jéjé" <willgart_A_@hotmail_A_.com> wrote in message
news:...
> it could be good for intranet usage and for complex form with edition
> capability.
> So for pages which are less used then navigation pages which are accessed
> by more users more frequently.
>
> remember that a large viewstate impact the bandwidth, and if there is a
> postback, the viewstate is sent back to the server, so again an impact on
> the network.
>
> In the past I have created a complex form with a lot of controls / sub
> controls etc.. designed to configure a chart online (the user can change
> the colors, axis, values, etc etc...)
> This form was really big with a big viewstate, but the user go to this
> page only 1 time a month.
> In another side, the page which render the chart is really small with a
> small viewstate because the page is accessed every day.
>
>
> "Mantorok" <> wrote in message
> news:dmk8fa$6qm$...
>> Thanks for the advice, do you think a large viewstate is a particularly
>> bad idea?
>>
>> Thanks
>> Kev
>>
>> "Jéjé" <> wrote in message
>> news:...
>>> deactivate the enableviewstate option for the controls where you don't
>>> have to store the state.
>>> for example, a menu, a simple list without any sort/select option
>>> authorized (no need to keep information during a postback). deactivating
>>> the viewstate for these controls reduce the size of the page.
>>>
>>> Lookat the http://localhost/folder/trace.axd file to identify which
>>> controls produce your viewstate.
>>>
>>> if you use .Net Framework 2.0, deactivating the viewstate for a grid
>>> keep the sort/select commands, while in 1.1 the entire state for the
>>> grid must be saved in the viewstate. (same thing for most of the
>>> controls in the v2.0)
>>>
>>> There is more options, likestoring the viewstate on the server side,
>>> applying some code to store only the requiered information in the state
>>> (but you have to repopulate your controls) etc...
>>>
>>> "Mantorok" <> wrote in message
>>> news:dmk2bk$33u$...
>>>> It's not unusual (to be lo....cough) for me to have VIEWSTATE ranging
>>>> from 1 full page to several pages.....
>>>>
>>>> This seems in-efficient - any ideas how to reduce the thing?
>>>>
>>>> Thanks
>>>> Kev
>>>>
>>>
>>>

>>
>>

>
>





Mantorok
  Reply With Quote
Old 12-02-2005, 04:26 AM   #7
gerry
 
Posts: n/a
Default Re: HUGE Viewstate
No 3rd party libs required.
Look into the SavePageStateToPersistanceMedium &
LoadPageStateFromPersistanceMedium Page methods.
These allow full server side viewstate persistance with as little as 2 lines
of code - 1 line of code in each method.
Gerry


"Thomas Skovsende" <t___hsk@net___peo--ple.d-k> wrote in message
news:%...
> Mantorok wrote:
> > It's not unusual (to be lo....cough) for me to have VIEWSTATE ranging

from 1
> > full page to several pages.....
> >
> > This seems in-efficient - any ideas how to reduce the thing?

>
> Jéjé came with a good suggestion...
>
> Another one: if you REALLY need the viewstate, google a bit on "flesk
> viewstate", which saves viewstate on the server and only sends an id to
> the client.
>
> And why this isnt possible to do without 3rd party libs is beyond me
>
> Best regards,
> Thomas Skovsende





gerry
  Reply With Quote
Old 12-02-2005, 11:51 AM   #8
Thomas Skovsende
 
Posts: n/a
Default Re: HUGE Viewstate
gerry wrote:
> No 3rd party libs required.
> Look into the SavePageStateToPersistanceMedium &
> LoadPageStateFromPersistanceMedium Page methods.
> These allow full server side viewstate persistance with as little as 2 lines
> of code - 1 line of code in each method.


Well - kindof!

I have to write a PageStatePersister class.

What i wanted from MS was something easily configurable from web.config.

Thomas Skovsende


Thomas Skovsende
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview delete viewstate problem erfeyut Software 0 05-27-2009 10:08 AM
viewstate MAC failed in asp.net 2.0 while postback the page azraffarveen Software 0 05-12-2009 03:24 PM
Bizzare ViewState issue (ASP.NET) dmartu Software 0 12-04-2008 10:26 AM
access viewstate meera_p9 Software 2 10-17-2007 12:18 PM
Huge sale on Season sets at Amazon... SoHillsGuy DVD Video 11 10-14-2004 07:11 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

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