Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > UserControl ViewState with dynamic child controls

Reply
Thread Tools

UserControl ViewState with dynamic child controls

 
 
ejstembler
Guest
Posts: n/a
 
      03-01-2006
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.

 
Reply With Quote
 
 
 
 
DWS
Guest
Posts: n/a
 
      03-02-2006
ejstembler,

Try putting the save button in the user control.

Good Luck
DWS

"ejstembler" wrote:

> 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.
>
>

 
Reply With Quote
 
 
 
 
ejstembler
Guest
Posts: n/a
 
      03-02-2006
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...


DWS wrote:
> ejstembler,
>
> Try putting the save button in the user control.
>
> Good Luck
> DWS
>
> "ejstembler" wrote:
>
> > 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.
> >
> >


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
losing viewstate in child controls when writing custom control spacehopper_man@yahoo.com ASP .Net 0 10-12-2005 09:18 PM
Id of child controls for UserControl Shimon Sim ASP .Net 6 06-17-2005 06:48 PM
HELP! Child controls of child controls not visible to web app lisa@starways.net ASP .Net Building Controls 0 05-05-2005 09:14 PM
Mixing child properties and child controls - how? Donal McWeeney ASP .Net Web Controls 3 02-14-2005 02:51 AM
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM



Advertisments