473,320 Members | 2,107 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,320 software developers and data experts.

Dynamic User Controls Question

I have a fairly complex form that needs to load and maintain the state
of several different dynamic user controls. Here is the workflow:

1) A series of editable user controls (each containing basic web form
elements: textboxs, buttons, etc) are loaded from an xml file.

2) The user can either edit these user controls or select from a list
of user controls to add to teh page.

3) The user clicks "save" to save the content of all of the
pre-existing and newly added user controls back to the xml file.

Here's the problem:

I have Step 1 working. But postbacks clear out the dynamic controls.
I can normally work around this by loading the controls in the init
method but this scenario is different. On the first pageload I need to
load the controls from the original source xml file which lists the
controls to be added. However, I the next postbacks I need to somehow
manage a list of the controls that need to be added because the user
will be adding more controls to this list. I'm thinking that I'll need
to somehow keep an ArrayList of contorls to load in the viewstate.

Any insight is appreciated, thanks.

Feb 20 '06 #1
1 1489
Your idea seems like the correct one (the arraylist)

As an alternative, you could try:
http://www.denisbauer.com/ASPNETCont...aceholder.aspx

which is meant to do all that for you.

karl

--
http://www.openmymind.net/
http://www.fuelindustries.com/
<np*****@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I have a fairly complex form that needs to load and maintain the state
of several different dynamic user controls. Here is the workflow:

1) A series of editable user controls (each containing basic web form
elements: textboxs, buttons, etc) are loaded from an xml file.

2) The user can either edit these user controls or select from a list
of user controls to add to teh page.

3) The user clicks "save" to save the content of all of the
pre-existing and newly added user controls back to the xml file.

Here's the problem:

I have Step 1 working. But postbacks clear out the dynamic controls.
I can normally work around this by loading the controls in the init
method but this scenario is different. On the first pageload I need to
load the controls from the original source xml file which lists the
controls to be added. However, I the next postbacks I need to somehow
manage a list of the controls that need to be added because the user
will be adding more controls to this list. I'm thinking that I'll need
to somehow keep an ArrayList of contorls to load in the viewstate.

Any insight is appreciated, thanks.

Feb 20 '06 #2

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

Similar topics

3
by: MikeY | last post by:
Hi Everyone, I am working in C#, windows forms.My question is this. All my button dynamic controls properties are present and accounted for except for the"FlatStyle" properties. I can't seem to...
1
by: Kelly | last post by:
Hi Everyone I have a web application and all it basically does is ask for a user id and show a questionnaire. To create the questionnaire, I get the list of questions from the database and...
1
by: sleigh | last post by:
Hello, I'm building a web application that will build a dynamic form based upon questions in a database. This form will have several different sections that consist of a panel containing one to...
4
by: John | last post by:
Hi all, I have posted this type of question quite a few times but to date, no-one has actually been able to provide me with a solution. I really need to understand how to do this properly. My...
3
by: Leo J. Hart IV | last post by:
OK, here's another question for the experts: I am building a multi-step (3 steps actually) form using a panel for each step and hiding/displaying the appropriate panel/panels depending on which...
9
by: Tarscher | last post by:
hi all, I have this seemingly simple problem. I have lost a lot of time on it though. When a user selects a value from a dropdownlist (static control) a dynamic control is generated. I have...
0
by: Eniac | last post by:
Hi, I've been working on a custom user control that needs to be modified and the validation is causing me headaches. The control used to generate a table of 4 rows x 7 columns to display all...
0
by: Scott Roberts | last post by:
I always thought that the viewstate "keys" included the control ID. As long as the control IDs were unique, there shouldn't be any conflicts. Well, it appears that that may not be the case with...
13
by: tommymo | last post by:
Hi everyone I'm new to this site and the world of ASP.Net C# programming. I have been learning controls and integrating them with a SQL database. So far I have been able to move along and understand...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.