blah blah blah is here! blah blah » Close

up0down
link

On one of my pages I query a database for a number of records and dynamically add child controls to a panel control on my page. The child controls of the Panel display specific data from each row returned by my query. How can I wire up c# event handlers for any of these dynamically created controls???
Rhys

last answered 2 years ago

1 answers

up0down
link

Say if your event handler is called ExecuteClick and your control is a button called Button1, then you may do:
<code>
Button1.Click += new System.EventHandler(this.ExecuteClick);
</code>
to wire it up.

up0down
link

Apologies, already sorted. I know how to wire up events but thought it may be different for dynamically created controls without checking for some reason.
I NEED COFFEE!!!
Rhys

This post was imported from csharpfriends, if you have a similiar question please ask it again.

All previous members have been migrated, hope you enjoy the new platform!

Feedback