加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

最开始.net ajax

发布时间:2020-12-16 01:01:30 所属栏目:百科 来源:网络整理
导读:只能向页面中添加 ScriptManager 的一个实例 FormView控件中实现DropDownList+Ajax级联时,整个页面只能有一个ScriptManager控件,且ScripManager控件不能放在FormView里,而应放在Form下,FormView控件之前,否则会出现“只能向页面中添加 ScriptManager 的

只能向页面中添加 ScriptManager 的一个实例

FormView控件中实现DropDownList+Ajax级联时,整个页面只能有一个ScriptManager控件,且ScripManager控件不能放在FormView里,而应放在Form下,FormView控件之前,否则会出现“只能向页面中添加 ScriptManager 的一个实例”的错误。

 

<body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager><!--asp:ScriptManager在这里,一个就足够了--> <div> <asp:UpdatePanel ID="UpdatePanel1" runat="server">> <!--asp:UpdatePanel 1在这里--> <div> <ContentTemplate> <!--ContentTemplate容器--> <div> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <asp:Button ID="Button1" runat="server" Text="Button"></asp:Button>

</ContentTemplate> </asp:UpdatePanel> <!--asp:UpdatePanel 1在这里--> <div> </div> <div> <asp:UpdatePanel ID="UpdatePanel2" runat="server" RenderMode="Inline"> <!--asp:UpdatePanel 2在这里--> <div>

<ContentTemplate> <asp:DropDownList ID="ddlBrand" runat="server" AutoPostBack="true"> <asp:ListItem Text="请选择所属品牌" Value="0" /> </asp:DropDownList> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="ddlCarxID" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel> <!--asp:UpdatePanel 2在这里--> <div>

<asp:DropDownList ID="ddlCarxID" runat="server"> <asp:ListItem Text="请选择汽车车系" Value="0"></asp:ListItem> </asp:DropDownList> </div> </form> </body>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读