Re: How to add an event handler at run time?
From: Niranjan (niranjan.marathe_at_ugs.com)
Date: 09/15/04
- Next message: Charles: "Creating a server control and using tabindex"
- Previous message: Steven Cheng[MSFT]: "RE: Server farm and fields of classes in session cache"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 15 Sep 2004 15:45:52 +0530
Jeff,
I guess you are adding the handler for the click event in the
"Page_PreRender" as by this time all the controls are created ready to be
rendered. I hope this helps.
Regards,
Niranjan
"Jeff" <Jeff@discussions.microsoft.com> wrote in message
news:A1B4F401-C9D6-4AE6-80F5-ABED23692FED@microsoft.com...
> I have created an array of buttons at run time and need to associate them
a
> click event. I have added the following routine as the event:
>
> public void UpdateClick(Object sender, EventArgs e)
> {
> lblError.Visible=true;
> lblError.Text="It worked";
> }
>
> Below I have included the line of code used to hook up the button with the
> event:
>
> btnUpdate[intElement1].Click+=new System.EventHandler(UpdateClick);
>
> The code in the click routine does not run when the button is clicked. Can
> anyone tell me what I am missing? Thanks in advance.
>
> Regards,
> Jeff
>
- Next message: Charles: "Creating a server control and using tabindex"
- Previous message: Steven Cheng[MSFT]: "RE: Server farm and fields of classes in session cache"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|