There's gotta be something that you are doin wrong in ur code...
R. Thomas
"YunusEmre" wrote:
> No, the call to DataBind still does harm and I don't know why it does that.
>
>
>
> "R. Thomas, aka Xtreme.Net" <removemeXtremeDotNet@hotmail.com.NoSpam> wrote
> in message news:A3C9C521-8685-42E7-90AA-C3C839B150BA@microsoft.com...
> > So, is everything ok now?
> > R. Thomas
> >
> > "YunusEmre" wrote:
> >
> >> after some painful hours before the screen I realized that it is not the
> >> postback that makes it fail but it is the DataBind(). The postbacks which
> >> call the DataBind method eventually make my TrialCtrl fail to persist its
> >> text through postbacks.
> >> I have some buttons on my custom control (which is a grid by the way),
> >> some
> >> of them are used for paging and sorting stuff. And naturally the event
> >> handlers of these buttons call the DataBind() sometime after doing that
> >> "paging and sorting stuff". When DataBind() is called, it somehow causes
> >> the
> >> text in the textbox to be deleted.
> >>
> >>
> >> "YunusEmre" <emrenews-maillist@yahoo.com> wrote in message
> >> news:OaNYPKn7EHA.1452@TK2MSFTNGP11.phx.gbl...
> >> > you are right. It works well on a clean page. Something I do is probaby
> >> > making it fail. I will try to figure out what it is and get back to
> >> > you.
> >> > Thanks...
> >> > Emre
> >> >
> >> > "R. Thomas, aka Xtreme.Net" <removemeXtremeDotNet@hotmail.com.NoSpam>
> >> > wrote in message
> >> > news:0634DD46-F02A-4DAE-99E3-2EA2529C8074@microsoft.com...
> >> >>I made a simple aspx page an put this in my onload
> >> >> TrialCtrl= new TextBox();
> >> >> form.Controls.Add( TrialCtrl );
> >> >> TrialCtrl.ID = "trialctrl";
> >> >> with public TextBox TrialCtrl; declared.
> >> >> It works good for me... the values stays there after every postback...
> >> >> I think they way you are overloading and inheritting has some
> >> >> problems..
> >> >> You were saying you are overloading right?
> >> >> Lets look into that.. cause the above code i showed u works perfectly
> >> >> fine...
> >> >> Hth...
> >> >> R. Thomas
> >> >>
> >> >> "YunusEmre" wrote:
> >> >>
> >> >>> In my situation there is no DB. I store the info that is used to
> >> >>> create
> >> >>> the
> >> >>> TextBox also in the ViewState.
> >> >>> After reading the article I tried something. I put the following
> >> >>> code...
> >> >>>
> >> >>> protected override void OnLoad(EventArgs e)
> >> >>>
> >> >>> {
> >> >>>
> >> >>> base.OnLoad (e);
> >> >>>
> >> >>> TrialCtrl= new TextBox();
> >> >>>
> >> >>> this.Controls.Add( TryCtrl );
> >> >>>
> >> >>> TrialCtrl.ID = "trialctrl";
> >> >>>
> >> >>> }
> >> >>>
> >> >>>
> >> >>>
> >> >>> ....into my class as an OnLoad event handler and it worked and also
> >> >>> didn't
> >> >>> work. What worked is that the value that the user enters into the
> >> >>> TextBox
> >> >>> survives the first PostBack, but not the others. After the second and
> >> >>> following postbacks the text is lost again. ... makes no sense ?!??
> >> >>> Any
> >> >>> idea
> >> >>> why this happens ?
> >> >>>
> >> >>>
> >> >>>
> >> >>> "R. Thomas, aka Xtreme.Net" <removemeXtremeDotNet@hotmail.com.NoSpam>
> >> >>> wrote
> >> >>> in message news:ACD2C1D3-D8B5-46F9-ACD2-D2AFC389C5A8@microsoft.com...
> >> >>> > Sorry I didn't read your first post properly.
> >> >>> > Ok, check this link out. It will solve your problem..
> >> >>> >
http://xtremedotnet.blogdrive.com/archive/53.html > >> >>> > Do lemme know if you managed to get out of your problem...
> >> >>> > Hth..
> >> >>> > R. Thomas
> >> >>>
> >> >>>
> >> >>>
> >> >
> >> >
> >>
> >>
> >>
>
>