![]() |
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. |
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. > |
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.