Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Slow page load due to viewstate (http://www.velocityreviews.com/forums/t385245-slow-page-load-due-to-viewstate.html)

Jman 01-16-2007 01:32 PM

Slow page load due to viewstate
 
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.


Cowboy \(Gregory A. Beamer\) 01-16-2007 01:51 PM

Re: Slow page load due to viewstate
 
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" <jellic.vandenreyken@gmail.com> wrote in message
news:1168954338.240602.182820@m58g2000cwm.googlegr 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.
>



Eliyahu Goldin 01-16-2007 02:08 PM

Re: Slow page load due to viewstate
 
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" <jellic.vandenreyken@gmail.com> wrote in message
news:1168954338.240602.182820@m58g2000cwm.googlegr 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.
>





All times are GMT. The time now is 09:13 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, 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 47 48 49 50 51 52 53 54 55 56 57