开发者

SelectedIndexChanged event doesn't fire

开发者 https://www.devze.com 2023-01-23 07:57 出处:网络
I have added the AutoPostBack = \"true\" attribute to the drop down list. It doesn\'t work. <asp:DropDownList CssClass=\"dropDownList\" ID=\"ddlBusinessUnit\"

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

精彩评论

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