Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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…

839 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