T
tyler.lloyd
Hi,
I am trying to develop an asp.net 2.0 page that dynamically adds
controls (Textbox Fields) to a page depending on items selected from a
treeview. I have however run into a bit of a tricky problem, I require
the controls to be added in a certain order (some controls should be
above others). This causes all kinds of fun when the data is posted
back. If a new control was added and it is positioned before existing
controls on the page it causes the control IDs to become de-synced.
For Example: A user adds five controls and fills in the text fields
then decides to add another control. When the new control is added all
the previously enter data disappears as all the control IDs no longer
match. (I tried setting the Control ID manually; it must be using
another ID)
The only way I can see around this is to pre-populate the whole page
with every control then hide the ones not selected (But this would not
scale well at all). Does anyone have any ideas? Or am I missing
something simple?
Any help would be most appreciated.
Thanks
Tyler
I am trying to develop an asp.net 2.0 page that dynamically adds
controls (Textbox Fields) to a page depending on items selected from a
treeview. I have however run into a bit of a tricky problem, I require
the controls to be added in a certain order (some controls should be
above others). This causes all kinds of fun when the data is posted
back. If a new control was added and it is positioned before existing
controls on the page it causes the control IDs to become de-synced.
For Example: A user adds five controls and fills in the text fields
then decides to add another control. When the new control is added all
the previously enter data disappears as all the control IDs no longer
match. (I tried setting the Control ID manually; it must be using
another ID)
The only way I can see around this is to pre-populate the whole page
with every control then hide the ones not selected (But this would not
scale well at all). Does anyone have any ideas? Or am I missing
something simple?
Any help would be most appreciated.
Thanks
Tyler