473,804 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.

Jan 16 '07 #1
2 3030
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" <je************ *****@gmail.com wrote in message
news:11******** **************@ m58g2000cwm.goo glegroups.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.
Jan 16 '07 #2
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" <je************ *****@gmail.com wrote in message
news:11******** **************@ m58g2000cwm.goo glegroups.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.

Jan 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2864
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a datagrid. I am using the viewstate object to store the Arraylist items on the page on postback. My PROBLEM is that I need to redirect the user to a new aspx page and on this new page i need to be able to access the items in my arraylist. Is this...
4
2808
by: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than one runat=server form on a asp.net page. However, I still want developers to be able to use asp.net controls to create some apps that are created on the page. So I need multiple forms on a asp.net page(doesn't everyone). I purchased the...
7
8550
by: Donal McWeeney | last post by:
Hi, I'm round-tripping some values my page requires using hidden form fields - my page class requires these values in its OnInit event. I would like to be able to use viewstate to do this - however the load viewstate does not happen until after OnInit and before OnLoad. Is there anything I can do to make the viewstate data available for my OnInit code. Any pointers to examples gratefully accepted.
8
4259
by: aualias | last post by:
I am rewriting a web page that was previously done with ColdFusion. It has a DataGrid and one column in the DataGrid is a dropdown list which is the same for all rows. The ItemDataBound code looks like this... // _viewDestinations is created once and stored in the ViewState
5
2797
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go to the database to get the next page. Is there a way to use the dataset to allow us to read back and forth in it instead of going back to the database to get it? Thanks,
1
1389
by: Petr SIMUNEK | last post by:
I have 3 buttons on the page. (Created dynamicaly inside For- next loop and hooked up to click event.) When different button is clicked i would like to save a different value to viewstate. In the same run I want to read this value from viewstate and load page back with different picture.. the problems are: - events from button fires after pageLoad is finished, so I can use it to
7
2115
by: Shadow Lynx | last post by:
I realize that his question has been asked, in many other forms, many times in this group. Even so, my tired eyes have not yet found a sufficient answer, so I've decided to "reask" it even though I'm sure this will offend some of the more seasoned verterans of this board. The Players: Consider a simple web form, which I'll call Page A, that has a couple of controls on it. It's not important what they are, only that they're static...
9
11321
by: Alexander van Doormalen | last post by:
I have a situation that user controls are dynamically loaded within a page. To know which control to 're-add' to the page I saved the control path in the ViewState. This Control is added using LoadControl in the Load event handler. This works fine however the user controls which need to be added need to load their ViewState aswell as the page itself. In this situation this isn't gonna work cause the ViewState is loaded before the Load...
5
2833
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
We have a page that is loading very slow. There is not a lot of data, not a lot of users are connected at the same time and the page does not produce an error, so I am not sure where to start to look for why it is slowing down. I thought about the DB first and added NOLOCK to a couple of stored procedures that were being run, but with no effect. Can someone offer some tips on where to start looking or how I can begin to diagnose this...
0
9712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10089
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9171
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7634
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.