list of drop downs

J

JohnZing

Hi,
i have a list of drop down lists.

The first one is populated with a Select Query
The Second one is populated with a select query where ParentID is the
first drop down list selected value
The Third.... and so on...

The problem is: How can I handle the events from the different drop down
lists?

My Code below only works when i click in the first drop down

Private WithEvents ddl As DropDownList

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
ddl = New DropDownList
ddl.AutoPostBack = True

' populate ddl code HERE

PH1.Controls.Add(ddl)
End Sub


Private Sub ddl_SelectedIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles ddl.SelectedIndexChanged
ddl = New DropDownList
ddl.AutoPostBack = True

' populate ddl code HERE

PH1.Controls.Add(ddl)
End Sub

Thank You
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top