Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Slow page load due to viewstate

Reply
Thread Tools

Slow page load due to viewstate

 
 
Jman
Guest
Posts: n/a
 
      01-16-2007
I have a selection window, here are some dropdownlist if i click on an
item in a dropdownlist the page reloads itself an puts the selected
item in a textbox. Then i can search on the value in the textbox.
The values in the dropdownlist is variable. In one of the dropdownlists
there are lots of values and my viewstate is very large. My page is
almost 3 mb. This is way too much to load every time.
I can not set my viewstate to false because then the page doesn't work
anymore as it should be. (The textbox doesn't fill and my dropdownlist
becomes empty).

I 'm searching for a way to disable the viewstate and not to do a
postback every time i want to change something in my page.
The person who made this page has moved to another company so i'm
practically new to this.

Can someone give me some way to fix my problem?
Thanks for the help.

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      01-16-2007
You have a couple of choices to trim down your page.

1. Use Ajax to refresh elements on the page when a dropdown item is selected
2. Use a wizard control (or panels - have to use panels in 1.x) to switch
out elements. Elements that are not visible do not re-download.

The third choice is to re-architect the page, and perhaps the application,
to change flow.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

********************************************
Think outside the box!
********************************************
"Jman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>I have a selection window, here are some dropdownlist if i click on an
> item in a dropdownlist the page reloads itself an puts the selected
> item in a textbox. Then i can search on the value in the textbox.
> The values in the dropdownlist is variable. In one of the dropdownlists
> there are lots of values and my viewstate is very large. My page is
> almost 3 mb. This is way too much to load every time.
> I can not set my viewstate to false because then the page doesn't work
> anymore as it should be. (The textbox doesn't fill and my dropdownlist
> becomes empty).
>
> I 'm searching for a way to disable the viewstate and not to do a
> postback every time i want to change something in my page.
> The person who made this page has moved to another company so i'm
> practically new to this.
>
> Can someone give me some way to fix my problem?
> Thanks for the help.
>


 
Reply With Quote
 
 
 
 
Eliyahu Goldin
Guest
Posts: n/a
 
      01-16-2007
Not everything in a web application has to be done on server side. You can
do many things on client side without round trips to the server. You need to
know a bit of javascript and html for this.

If upon a selection in the dropdown you just need to fill up a textbox, it
is a typical client side task. If you need also to do something with the
database, you must go to the server for this, everything depends on your
specific requirements. You may find an compromise in Ajax.

You can disable/enable viewstate for every control separately with the
EnableViewState property.

Another option for reducing the viewstate size is to disable it for the
viewstate-hungry controls and reload them on every postback on server side.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net


"Jman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>I have a selection window, here are some dropdownlist if i click on an
> item in a dropdownlist the page reloads itself an puts the selected
> item in a textbox. Then i can search on the value in the textbox.
> The values in the dropdownlist is variable. In one of the dropdownlists
> there are lots of values and my viewstate is very large. My page is
> almost 3 mb. This is way too much to load every time.
> I can not set my viewstate to false because then the page doesn't work
> anymore as it should be. (The textbox doesn't fill and my dropdownlist
> becomes empty).
>
> I 'm searching for a way to disable the viewstate and not to do a
> postback every time i want to change something in my page.
> The person who made this page has moved to another company so i'm
> practically new to this.
>
> Can someone give me some way to fix my problem?
> Thanks for the help.
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: slow slow slow! Expert lino fitter Computer Support 0 12-10-2008 02:33 PM
How to due with "warning LNK4075: ignoring '/INCREMENTAL' due to Fresh C++ 2 04-22-2008 09:03 PM
Errors: Failed to load viewstate. & Validation of viewstate MAC failed. sck10 ASP .Net 6 09-01-2006 05:59 PM
Failed to load viewstate. The control tree into which viewstate... Josema ASP .Net Building Controls 2 05-22-2005 10:38 AM
Failed to load viewstate. The control tree into which viewstate... Josema ASP .Net Web Controls 0 05-09-2005 10:58 AM



Advertisments