addhandler事件触发不了 高手进来!!
我做了一个下拉框,选择后触发生成一个下拉框,当我扑捉新生成的下拉框的时候用addhandler,但是却扑捉不了,请高手解释!!一下是简化 代码Protected Sub ddlBelongs123_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlBelongs123.SelectedIndexChanged
Dim dpl1 As DropDownList = New DropDownList
AddHandler dpl1.SelectedIndexChanged, AddressOf dpp
Call selectchange(dpl, dpl1)
end sub
Sub dpp(ByVal sender As System.Object, ByVal e As System.EventArgs)
MsgBox("sdf")
End Sub
#Region ""
Private Function selectchange(ByVal dpl As DropDownList, ByVal dpl1 As DropDownList)
dpl1.ID = table3.Rows.Count + 1
upid1.Controls.Add(dpl1)
“这行是下拉框绑定,我省略了”
End Function