try overriding the onbubbleEvent function of your container and check to see
who is postingback, if its the onNext button try and retrieve your text.
http://www.aboutfortunate.com/Default.aspx
As you will note from that code in the link, they are overriding the
onBubbleEvent of the container, in your case this is the same place where
you are trying to retrieve the values. That is where you loaded the
control(The container for your usercontrol)
I think you are trying to retrieve your values before your usercontrol has
been restored. Surely you already know that when dynamically loading
controls the viewstate is not restored until the control is reloaded again.
If you can trap the event in your container and try retrieving the value
when this event fires, that should work for you. Otherwise try retrieving
the value right after the code where you are reloading your dynamic controls
fire, or any methods that fire afterwards.
The code you posted is still very little and I dont know on what method you
are loading your controls, and if that code is run after a postback etc nor
what the flow of your program is, but surely you should be on the right
track now
"Justin" <> wrote in message
news:CF3C83C4-08D2-4697-933E-...
> OK Alessandro,
>
> Here is the code you requested:
>
> // Load wizard placeholder with next user control
> wizardTabPlaceHolder = GetPlaceHolder(wizardTab); // This just finds the
placeholder in a tab control
> wizardTabPlaceHolder.Controls.Remove(currentUserCo ntrol); // I remove the
last visited control
> WizardUserControl nextControl =
> (WizardUserControl)Page.LoadControl(controlFileNam e); // Now I load
the control
> wizardTabPlaceHolder.Controls.Add(nextControl); // THen add it to the
placeholder.
>
> So, according to you there are some extra things that I need to do. What
properties do I need to set?
>
> At this point the only controls within this user control being loaded are
labels and textboxes. So as a user, when a user control is loaded I type in
text, then I click next. Now I want to be able to retreive the text in the
code behind of this control before I load the new control. The problem is
when I try to get the text the textboxes claim to be empty strings. This is
what I mean by no events firing. I guess its more of a timing thing, the
events are probably firing but I do not know when to catch them so that I
can get the text.
>
> The code above is called in my OnNext() method. I try to retreive the
text before the call to the above code.
>
> As far as bubbling the events up, I have not done that yet. I guess
because I do not know how to do it dynamically.
>
> Thanks for your quick response, I will look into the bubbling up.
>
> Justin
>
>