From: Andy M. <am...@st...> - 2006-05-02 19:13:58
|
Your web form will need to keep track of whether the user control is part of the page or not (I would use ViewState), then re-add it during each callback: In the Button1 client event handler: AddUserControl(); this.ViewState["UserControlAdded"] = true; In the Web Form Page Load event handler: if ( null != this.ViewState["UserControlAdded"] && (bool) this.ViewState["UserControlAdded"] ) AddUserControl(); Andy -----Original Message----- From: Mike Weichert [mailto:mwe...@gm...] Sent: Tuesday, May 02, 2006 12:00 PM To: Andy Miller Subject: Re: [Anthem.NET-users] Adding controls at runtime... This is what I have: Web Form contains Button1. After I click Button1, a User Control is added to the Web Form. User Control contains Button2. After I click on Button2, the User Control disappears. I understand that I need to readd the control during the callback, but I have no idea of how to go about that. Thanks for the reply! Mike On 5/2/06, Andy Miller <am...@st...> wrote: > Are you adding either the user control or the anthem:button at runtime? If > so, then I'd guess you are not adding again them during the callback. > > Andy > > -----Original Message----- > From: ant...@li... > [mailto:ant...@li...] On Behalf Of Mike > Weichert > Sent: Tuesday, May 02, 2006 8:09 AM > To: ant...@li... > Subject: [Anthem.NET-users] Adding controls at runtime... > > Hi guys, > > I've managed to create a user custom control that I can add to an > anthem:panel now, without problem. However, on my custom control is an > anthem:button - and as soon as I click it, "poof!" the custom control > disappears. > > I really appreciate any help I can get on this one. > > Thanks, > Mike > > > > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > anthem-dot-net-users mailing list > ant...@li... > https://lists.sourceforge.net/lists/listinfo/anthem-dot-net-users > -- Be still like a mountain, and flow like a great river. --Lao Tse // This is my personal e-mail account // that I use for communication only. // Please send any e-mails with attachments // to mwe...@wi.... |