我有一个ddl
工作updatePanel
正常。但是当我选择第一项 {value:"null",Text:""} 它不会触发。
C#
ddlCat.DataSource = DataBase.GetTable("select ymc_name,ymc_id from Y_MainCat");
ddlCat.DataTextField = "ymc_name";
ddlCat.DataValueField = "ymc_id";
ddlCat.DataBind();
ddlCat.Items.Insert(0, new ListItem("", "null"));
ddlCat.SelectedValue = "null";
html:
<asp:DropDownList ID="ddlCat" runat="server" AutoPostBack="True" OnTextChanged="ddlCat_TextChanged"></asp:DropDownList>
<asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DropDownList ID="ddlSubCat0" runat="server"></asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlCat" EventName="TextChanged" />
</Triggers>
</asp:UpdatePanel>