UserControl ViewState with dynamic child controls

E

ejstembler

I have a custom UserControl where the content is dynamically generated
when the containing Page calls a certain method (i.e. DisplayData).
The content of the UserControl is a dynamically generated Table with
several Rows and several Cells. Some of the Cells contain a TextBox
which the end-user can type text into. The Page which contains this
UserControl has a "Save" button which generates a post-back.

The problem I'm having... When the end-user presses the "Save" button a
post-back is generated, however, the UserControl's table is empty. I
can save the table in the Session after generating it, but that doesn't
give me access the the text from TextBoxes.

Anyone know the proper way to do this?

TIA.
 
E

ejstembler

I cannot do that in this case.

I see that this is a common issue after reading several posts here and
the other ASP.Net newsgroups. Unfortunaly, I didn't find a solution.

Basically I have a composite Control which dynamically generates child
controls via CreateChildControls. However the this.Controls collection
is empty after a post-back is fired and then CreateChildControls is
eventually re-called. I just need to find a way to get the child
controls to persist...
 

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,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top