D
Dune
I have a web form that has a button called "Add Blank Row".
Every time this button is pressed a new "blank row" user
control should be added to the web form. This is done
dynamically in the button's event handler by calling
Page.LoadControl(). Everything works ok except that the
web form can't seem to remember the user controls that are
added.
The moment a postback occurs, any user controls that exist
disappear.
With some googling, I found a page which said "you must
load dynamically created controls on EVERY postback".
Is this true?And if so, could someone please explain why
and how to work around it?
(I assume it would require keeping track of the user
controls as they are added but I can't think of a
efficient way to go about doing this)
Cheers, Dune
Every time this button is pressed a new "blank row" user
control should be added to the web form. This is done
dynamically in the button's event handler by calling
Page.LoadControl(). Everything works ok except that the
web form can't seem to remember the user controls that are
added.
The moment a postback occurs, any user controls that exist
disappear.
With some googling, I found a page which said "you must
load dynamically created controls on EVERY postback".
Is this true?And if so, could someone please explain why
and how to work around it?
(I assume it would require keeping track of the user
controls as they are added but I can't think of a
efficient way to go about doing this)
Cheers, Dune