473,382 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Multiple User Controls and ViewState

Hello,
I have a question: what happens if multiple user controls (sometime
of the same type)
write in the same ViewState key ?
Each one erase previous values?
To avoid this have I to prefix the ViewState keu with a
"this.clientID" ???

Thanks

Jul 12 '07 #1
2 3001
Every Control has its own ViewState, so you don't need to worry about this.

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net

"Maury" <ma**************@gmail.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...
Hello,
I have a question: what happens if multiple user controls (sometime
of the same type)
write in the same ViewState key ?
Each one erase previous values?
To avoid this have I to prefix the ViewState keu with a
"this.clientID" ???

Thanks

Jul 12 '07 #2
basically its keyed by the UniqueID. this is why your control must
render with the same name on postback to access its viewstate.

-- bruce (sqlwork.com)

Kevin Spencer wrote:
Every Control has its own ViewState, so you don't need to worry about this.
Jul 12 '07 #3

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

Similar topics

3
by: D. Shane Fowlkes | last post by:
Sorry for the length of this post. I have created a rather complex form which has a header/line item (parent and child records) structure. It's for an intranet. A screenshot can be seen here: ...
9
by: james.e.coleman | last post by:
Hello, I have created a custom dropdownlist that is used multiple times within a single page. When trying to set the values of the controls with the page in which they are being used, they all...
3
by: Nathan Sokalski | last post by:
When I view any page in my application a second time, I recieve the following error: System.Web.TraceContext.AddNewControl(String id, String parentId, String type, Int32 viewStateSize) +313...
9
by: Jamie | last post by:
I am receiving an Invalid ViewState error after posting back to the same page twice. Consistently the error occurs after the second postback and not after the first. I have looked into creating...
1
by: SteveComplex | last post by:
I'm currently working on a project developing a web application that makes heavy use of 3rd-party controls, popup windows and frames ( not my design I hasten to add ). Some of the pages make use...
7
by: David Lozzi | last post by:
Howdy, I have a usercontrol in my aspx page and when the page loads, I send it some property values based on the data displayed. I am sending it to a public property like below. However the...
2
by: Chris | last post by:
I am getting a viewstate error when adding dynamically user controls. SYSTEM_EXCEPTION:Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree...
0
by: Maury | last post by:
Hello, I have a question: what happens if multiple user controls (sometime of the same type) write in the same ViewState key ? Each one erase previous values? To avoid this have I to prefix the...
2
by: Rotsey | last post by:
Hi, I have a web site that uses user controls to display different formats of timesheets. I have a browse page that has prev/next buttons to browse through a set of timesheets. As I say...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.