Re: Changing controls after an event
- From: Brock Allen <ballen@xxxxxxxxxxxxxxxxx>
- Date: Thu, 07 Apr 2005 05:44:52 -0700
You're going to need to have some state information somewhere that tells your server code what controls to recreate upon postback. You should recreate these controls in Page_Init (if it's directly in the Page) or override CreateChildControls, or if it's an ASCX then Page_Load is also a fine place to recreate these controls.
-Brock DevelopMentor http://staff.develop.com/ballen
Ah, can't do that as the forms are gernerated from data.. I just have some code that's called for all forms so that I can put any special coding for onchange in if needed.
"Eliyahu Goldin" <removemeegoldin@xxxxxxxxxxxxxx> wrote in message news:%23U9O0n1OFHA.1176@xxxxxxxxxxxxxxxxxxxxxxx
Adrian,
The easiest way is to prepare all controls in design time and switch their visibility on events.
Eliyahu
"Adrian Parker" <apparker@xxxxxxxxxx> wrote in message news:u4RJbh1OFHA.3704@xxxxxxxxxxxxxxxxxxxxxxx
I have a form with some controls on it, one of them has an auto postback onchange. So the postback occurs but before the event fires, all the controls are recreated. so my question is, if the event requires you to replace a control with another type, e.g. replace a textbox with a date control, how do I get it to redo the form with the new control, force another postback ? if so , how ?
Thanks Adrian Parker
.
- References:
- Re: Changing controls after an event
- From: Adrian Parker
- Re: Changing controls after an event
- Prev by Date: Re: newbie question
- Next by Date: Re: Drawing in Custom Controls
- Previous by thread: Re: Changing controls after an event
- Next by thread: Drawing in Custom Controls
- Index(es):
Relevant Pages
|