How to add an event handler to a dynamic control ie DropDownList...?
Posted on 2011-02-15
I am adding controls to table cells dynamically using Controls.Add(myTextbox) etc. However I cannot see how I can define which "SelectedIndexChanged" event handlier should be triggered. Also the ID is not known so one cannot add it to the "Handles" bit of an event handler. If one was doing this in an ASPX then one would use something like:
I can define "Autopostback = True" in code however.
Appreciate any help.