view state causing pages to slow down - please help

  • Thread starter Thread starter Joey
  • Start date Start date
J

Joey

Hi There,

I have a page that has 2 listbox contols on it, the page also has a form
with a 10 textboxes and a few labels. When the page loads at runtime it
takes way too long to apear and then when I view source on the page the view
state information is huge! Given that I have two bound listbox controls on
the page how can I minmise the performance hit by the view state?

Joey
 
Hey Joey,

Have you set viewstate off for all controls that don't need to be tracked
during postbacks? Labels don't usually need it.

Ken
 
Hi

The only thing I can think of is to disable view state for the page;

<%@ Page EnableViewState=”false” %>

Then, if you need to maintain state on the page, create an object tha
stores the values of the form's elements and save the object to th
Session array.

When the form reloads (for example, a user has failed to fill out
required field) retrieve the object from the Session array and populat
the form fields.

It may seem excessive but it means state is maintained on the server
rather than going out to the client and then back again


-
spaldin
 
Back
Top