N
npverni
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.
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.