开发者

SelectedIndexChanged event doesn't fire

I have added the AutoPostBack = "true" attribute to the drop down list. It doesn't work.

<asp:DropDownList CssClass="dropDownList" ID="ddlBusinessUnit" 
                  AutoPostBack="true" runat="server" Width="250px"   
                  OnSelectedIndexChanged="ddlBusinessUnit_SelectedIndexChanged">
</asp:DropDownList>

code behind:

Protected Sub ddlBusinessUnit_Select开发者_开发知识库edIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
    Response.Write("Hello")
End

How can I ensure that the event method is called?


Are you populating your Dropdownlist on every Postback?

Use IsPostBack to check whether the page is loaded for the first time or not.

If Not IsPostBack Then
   BinDdlBusinessUnit()
End If
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜