view state causing pages to slow down - please help

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
 
K

Ken Cox [Microsoft MVP]

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
 
S

spalding

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top