AddHandler和AddressOf问题
我做了一个下拉框后,触发后动态生成了2个下拉框,代码如下Protected Sub ddlBelongs123_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlBelongs123.SelectedIndexChangedDim dpl As DropDownList = New DropDownList
Dim dpl1 As DropDownList = New DropDownList
dpl.ID = table3.Rows.Count
dpl1.ID = table3.Rows.Count + 1
upid1.Controls.Add(dpl)
upid1.Controls.Add(dpl1)
End Sub
我现在想触发dpl1下拉框的事件 要用到AddHandler: AddHandler dpl1.SelectedIndexChanged, AddressOf dpp
Sub dpp(ByVal sender As System.Object, ByVal e As System.EventArgs)
MsgBox("sdf")
End Sub
请问我这个AddHandler dpl1.SelectedIndexChanged, AddressOf dpp
要加在那里啊,才能触发dpl1这个控件;