dynamic generated buttons

G

Guest

I heve this webform with a checkboxlist and a button.
Based on which checkboxes are checked, several textboxes and Buttons are
generated.

When I click one of these buttons, the page goes in postback, and everything
has disappeared from the form

All the help I can find is about a predefined amount of Generated user
controls in the pageLoad or Init, but that's not much of use in my particular
situation...

Anyone an Idea ?
 
E

Eliyahu Goldin

You have to recreate dynamically generated controls on every postback.

Eliyahu
 
G

Guest

uhh....
and how would you retrieve the ones that are created ?
in a Session ?
or any alternative ...
 
B

Brock Allen

When you dynamically add controls into the page it is up to you to recreate
them upon postback. The two places to do this is in Page_Init or CreateChildControls.
If you're doing this from a user control you can also do this from Page_Load.

The challenge is storing the necessary state information to remember what
controls to add.
 
E

Eliyahu Goldin

Difficult to say without knowing details. Anything between re-creating
following the same logic as for creating and pre-setting in design time.

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top