Server side viewstate

  • Thread starter Thread starter emde
  • Start date Start date
In looking for a way to trim down viewstate, I came across the
following articles to store viewstate in session:

http://aspalliance.com/72

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/PgStPrst.asp


It appears as if the first link is actually better as it allows for a
"history" of viewstates to be availabale.

Anyone have experience using either one of these methods?

ViewState, as with hundreds of other features of ASP.NET, is extremely
useful when it's extremely useful.

But let's not get too carried away here - ViewState *does* add a bit of
overhead to every page which uses it, but unless the page is huge with loads
and loads of WebControls and HTMLControls, it's probably not going to make
that much of a difference to most users. It's just text after all. The page
may take a second or so longer to load, but that's about it...

If the page is huge with loads and loads of WebControls and HTMLControls,
then it's been badly designed in the first place, so ViewState really is the
least of your worries...:-)

There are loads and loads of ways to improve the performance of ASP.NET
sites, but ViewState is IMO opinion fairly far down the list.

By all means be aware that it's always a "good thing" to minimise the amount
of traffic between server and client and back again, so set
EnableViewState="false" for all those controls which don't need it - but
it's really not necessary to devote any more time to it than that...
 
Mark said:
There are loads and loads of ways to improve the performance of ASP.NET
sites, but ViewState is IMO opinion fairly far down the list.
...
By all means be aware that it's always a "good thing" to minimise the amount
of traffic between server and client and back again, so set
EnableViewState="false" for all those controls which don't need it - but
it's really not necessary to devote any more time to it than that...


While I agree with you, I am working with the wizard control and
viewstate gets out of hand really quick :)
 
While I agree with you, I am working with the wizard control and
viewstate gets out of hand really quick :)

Hmm - it shouldn't if you're careful... You really only need to enable
ViewState on the controls within the individual panels...

That said, I really don't like the Wizard control / <asp:MultiView> control
for just this reason...

It also makes client-side validation almost impossible because only the
controls in the current panel are actually streamed down to the client...

I really wish Microsoft had come up with something along the lines of the
old IE:WebControls for this in ASP.NET 2...I realise that they were for IE
only but, in an enclosed corporate intranet where all client machines are
running IE, the IE:WebControls were truly superb...
 
Back
Top