Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to add an event handler to a dynamic control ie DropDownList...?

Posted on 2011-02-15
1
Medium Priority
?
547 Views
Last Modified: 2012-05-11
Hi,

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:

OnSelectedIndexChanged="_DDLB_SelectedIndexChanged"

I can define "Autopostback = True" in code however.

Appreciate any help.

Thanks,

Sam
0
Comment
Question by:SamJolly
1 Comment
 

Accepted Solution

by:
SamJolly earned 0 total points
ID: 34896205
Sorted:

AddHandler ddl.SelectedIndexChanged, AddressOf _ddlb_SelectedIndexChanged
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question