Solved

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

Posted on 2011-02-15
1
538 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 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