C
Chris Botha
I am adding controls dynamically to the page as per the samples there are on
the Web and it works - I can create text boxes, buttons, my own user
controls, whatever, on the fly and initialize them and add them to a
placeholder no problem.
However when I post back and the page displays again then all of the
controls are gone. I create them when the IsPostBack is false, because the
idea is to validate on post back, and if the data is invalid then the
controls should keep whatever the user entered and the user can correct it.
My question - how can I create for example one text box (when IsPostBack is
false), add it to the placeholder and after the user posted, the text box
will still be on the page and will contain the text the user entered (=
should behave as if the text box was added by the designer).
Thanks.
the Web and it works - I can create text boxes, buttons, my own user
controls, whatever, on the fly and initialize them and add them to a
placeholder no problem.
However when I post back and the page displays again then all of the
controls are gone. I create them when the IsPostBack is false, because the
idea is to validate on post back, and if the data is invalid then the
controls should keep whatever the user entered and the user can correct it.
My question - how can I create for example one text box (when IsPostBack is
false), add it to the placeholder and after the user posted, the text box
will still be on the page and will contain the text the user entered (=
should behave as if the text box was added by the designer).
Thanks.