返回列表 发帖

如图
是想实现这么个功能的
类型那个下拉框数据是这样的
C# code

<asp:DropDownList ID="DropDownList_Fid" runat="server" ValidationGroup="A" AppendDataBoundItems="True"
                    Width="200px" CausesValidation="True" AutoPostBack="True"
                    onselectedindexchanged="DropDownList_Fid_SelectedIndexChanged">
                    <asp:ListItem Value="0">请选择分类</asp:ListItem>
                    <asp:ListItem Value="2">专业网站推荐</asp:ListItem>
                    <asp:ListItem Value="1">科技网站导航</asp:ListItem>
                </asp:DropDownList>


如果我选择的是value=2的也就是专业网站推荐的话
下面那个下拉框就会被禁用。
也就是这段代码。
C# code

   protected void DropDownList_Fid_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (DropDownList_Fid.SelectedValue == "2")
            {
                DropDownList1.Enabled = false;
            }
        }


可是,我现在选择那个类型下拉框
它不会执行到这事件里。
怎么回事?

TOP

up

TOP

d

TOP


一个页面只能有一个form 据说如果用控件的话

TOP

autopostback 改成true

TOP

把drowdownlist改成  <select> </select>

TOP

d

TOP

返回列表