html:
<EditItemTemplate>
<asp:DropDownList id="DropDownList1" OnSelectedIndexChanged ="change" runat="server"></asp:DropDownList>
</EditItemTemplate>
.vb:
Sub change(ByVal s As Object, ByVal e As EventArgs)
Response.Write("<script>alert('ssssssssss');</script>")
End Sub
把对应的DropDownList的标签中加上 OnSelectedIndexChanged="ddlIndexChanged" AutoPostBack=True
同时在你的代码部分加上
Protected Sub ddlIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
you can just add the handler on the <asp:DropDownList> tag, or see (it is for DataList, but it is similar for DataGrid)
Bubbling the SelectedIndexChanged Event of a DropDownList to its DataList Container
http://authors.aspalliance.com/hmcheung/Articles/030331/Default.aspx