axps页面:
<asp:ScriptManager runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="ddlBrand" runat="server" OnSelectedIndexChanged="ddlBrand_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="请选择所属品牌" Value="0" />
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlCarxID" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<asp:DropDownList ID="ddlCarxID" runat="server">
<asp:ListItem Text="请选择汽车车系" Value="0"></asp:ListItem>
</asp:DropDownList>
后台:
protected void ddlBrand_SelectedIndexChanged(object sender, EventArgs e)
{
}
为什么DropDownList 调用不了OnSelectedIndexChanged事件,求高人指教
<asp:ScriptManager runat="server"></asp:ScriptManager> <asp:UpdatePanel ID=
答案:2 悬赏:0 手机版
解决时间 2021-02-22 22:44
- 提问者网友:龅牙恐龙妹
- 2021-02-22 16:29
最佳答案
- 五星知识达人网友:夜余生
- 2021-02-22 17:29
axps页面:
<asp:ScriptManager runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="ddlBrand" runat="server" OnSelectedIndexChanged="ddlBrand_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="请选择所属品牌" Value="0" />
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlCarxID" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<asp:DropDownList ID="ddlCarxID" runat="server">
<asp:ListItem Text="请选择汽车车系" Value="0"></asp:ListItem>
</asp:DropDownList>
后台:
protected void ddlBrand_SelectedIndexChanged(object sender, EventArgs e)
{
<asp:ScriptManager runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline">
<ContentTemplate>
<asp:DropDownList ID="ddlBrand" runat="server" OnSelectedIndexChanged="ddlBrand_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="请选择所属品牌" Value="0" />
</asp:DropDownList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlCarxID" EventName="SelectedIndexChanged" />
</Triggers>
</asp:UpdatePanel>
<asp:DropDownList ID="ddlCarxID" runat="server">
<asp:ListItem Text="请选择汽车车系" Value="0"></asp:ListItem>
</asp:DropDownList>
后台:
protected void ddlBrand_SelectedIndexChanged(object sender, EventArgs e)
{
全部回答
- 1楼网友:琴狂剑也妄
- 2021-02-22 17:52
在页面中使用updatepanel需要有scriptmanager控件,而且scriptmanager控件最好放在所有updatepanel的前面。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯