473,569 Members | 2,852 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Viewstate only being maintained second time around

Hi all,

I have a problem with viewstate being maintained. I use LoadControl to load
a user control and the data is sent down to the client correctly. However,
when I change some data and post it, the viewstate does not seem to load for
the user control upon sending it back down to the client. If I change the
data again, then the viewstate DOES seem to be maintained.

What gives?

Regards
John.
Nov 17 '05 #1
1 1501
John,

You have to be very careful when using load control and viewstate. The
control needs to be reloaded each time.

I'm using this technique on my own website and it's working quite well. I
have some demo code on how to do this in my code library: Just go to
www.aboutfortunate.com and search in the code library for: dynamic user
control.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
"John" <a@b.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
Hi all,

I have a problem with viewstate being maintained. I use LoadControl to load a user control and the data is sent down to the client correctly. However,
when I change some data and post it, the viewstate does not seem to load for the user control upon sending it back down to the client. If I change the
data again, then the viewstate DOES seem to be maintained.

What gives?

Regards
John.

Nov 17 '05 #2

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

Similar topics

1
1208
by: John | last post by:
Hi all, I have a problem with viewstate being maintained. I use LoadControl to load a user control and the data is sent down to the client correctly. However, when I change some data and post it, the viewstate does not seem to load for the user control upon sending it back down to the client. If I change the data again, then the viewstate...
10
2247
by: neo | last post by:
hi, I am studying ASP.NET and have few questions - 1) The session ID and values of controls is stored in VIEWSTATE variable. So now when we put EnableViewState="false" in Page directive and disable the session state in Web.Config the VIEWSTATE variable is still maintained and stores some values. Can anyone tell what those values are for,...
5
1312
by: DC Gringo | last post by:
I have an asp.net vb page with two web user controls on it. The first user control, uc1.ascx has a series of list boxes that are populated in series by each other with ONSELECTEDINDEXCHANGED. In the second control, uc2.ascx, lower down on the page, there is an imagebutton. When the imagebutton is clicked, it goes to the same page with a...
28
21114
by: Vishwanathan Raman | last post by:
Hi I am aware of the technical differences.But would like to get it clarified.Given an oppurtunity is ViewState storage more efficient than Session based.I do not have a scenario where I need to share information across pages but have lots of information to cache for that page.Can you please advise which is the efficient way to do it.The...
1
4823
by: russ | last post by:
Hi all, Here's a problem I'm having with a dynamic table. Following the guidelines here (http://www.codeproject.com/aspnet/dynamiccontrols.asp), which make perfect sense. The problem is that the table contains a SELECT box populated on the initial load. Every time I postback I'm inserting a column into the table, the dropdown always...
1
2304
by: batista | last post by:
Hello, I have a web page, which is being refresh after every 30 secs.Now, there is also a datagrid in it, which i bind in the pageload event. Now the problem is when the page is refresh after 30 secs the datagrid loses it's values. I mean it does not maintain it's viewstate. Why is it?
7
2116
by: GS | last post by:
Hello, I'm receiving The state information is invalid for this page and might be corrupted error message when running code below. This happens on second post back. Why is it happening? My webpage contains 2 dropdowns controls and I save information entered by user in ViewState variable containing array ArrayList MyCoordinates =...
0
1895
by: John | last post by:
I am loading my controls dynamically into my asp.net page. When I click on a button on one of those user controls then page reloads and I need to reload the page based on what has happened in the button click. Problem is that the button click is the last thing to fire so I need to reload the page a second time to update the controls based on...
3
626
by: George Thompson | last post by:
Hi, I come from an ASP background, and I am currently working on a .NET project, so please excuse me if this is a dumb question ... I have written a dynamically generated menu that uses the following structure (looping through for each menu item needing to be displayed): <tr>
0
7703
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...
0
7619
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...
0
7930
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. ...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
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...
0
5228
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...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.