UpdatePanel问题.第一次使用“更新"面板AJAX

编程入门 行业动态 更新时间:2024-10-26 12:27:54
本文介绍了UpdatePanel问题.第一次使用“更新"面板AJAX的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

你好朋友, 我在aspx页面中编写了以下代码:

Hello Friends, I have written a following code in my aspx page:

<asp:UpdatePanel runat="server" id="HoodUpdatePane" updatemode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="RBLstSeries" EventName="SelectedIndexChanged"/> </Triggers> <ContentTemplate> <asp:RadioButtonList ID="RBLstSeries" runat="server" onselectedindexchanged="RBLstSeries_SelectedIndexChanged"> <asp:ListItem Text="ELXC" Value="ELXC" Enabled="false"></asp:ListItem> <asp:ListItem Text="ELXC-UVi" Value="ELXC-UVi" Enabled="false"></asp:ListItem> <asp:ListItem Text="ELX" Value="ELX" Enabled="true" Selected="True"></asp:ListItem> <asp:ListItem Text="ELX-UVi" Value="ELX-UVi" Enabled="false"></asp:ListItem> <asp:ListItem Text="PG" Value="PG" Enabled="false"></asp:ListItem> <asp:ListItem Text="VH2" Value="VH2"></asp:ListItem> </asp:RadioButtonList> </ContentTemplate> </asp:UpdatePanel>

但仍然在单选按钮上,单击返回整个页面..我是第一次使用AJAX,请帮助...代码中还需要添加其他内容吗?

but still on radio button click whole page post back..I m using AJAX first time,plz help...anything else has to be added in code?

推荐答案

嘿, 将ur RBLstSeries的AutoPostback属性设置为true 或按照以下内容替换您的代码 Hey, set AutoPostback property true of ur RBLstSeries or replace ur code by following <asp:UpdatePanel runat="server" ID="HoodUpdatePane" UpdateMode="Conditional"> <ContentTemplate> <asp:RadioButtonList ID="RBLstSeries" runat="server" AutoPostBack="True" onselectedindexchanged="RBLstSeries_SelectedIndexChanged" > <asp:ListItem Text="ELXC" Value="ELXC" Enabled="false"></asp:ListItem> <asp:ListItem Text="ELXC-UVi" Value="ELXC-UVi" Enabled="false"></asp:ListItem> <asp:ListItem Text="ELX" Value="ELX" Enabled="true" Selected="True"></asp:ListItem> <asp:ListItem Text="ELX-UVi" Value="ELX-UVi" Enabled="false"></asp:ListItem> <asp:ListItem Text="PG" Value="PG" Enabled="false"></asp:ListItem> <asp:ListItem Text="VH2" Value="VH2"></asp:ListItem> </asp:RadioButtonList> <br /> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> </ContentTemplate> </asp:UpdatePanel>

并在aspx.cs页面中添加以下事件

and in aspx.cs page add following event

protected void RBLstSeries_SelectedIndexChanged(object sender, EventArgs e) { Label1.Text = "Post back Done"; }

希望您的问题得到解决 祝你好运 快乐的编码

hope ur problem is solved best Luck happy coding

RBLstSeries是UpdatePanel的子级,您不需要为其添加AsyncPostBackTrigger.在UpdatePanel上设置ChildrenAsTriggers = true. RBLstSeries is a child of the UpdatePanel, you don''t need to add AsyncPostBackTrigger for it. Set ChildrenAsTriggers=true on the UpdatePanel.

请检查正在执行页面的浏览器.Googlechrome将不支持Ajax. 谢谢, 灰烬 Please check the browser in which you are executing your page.Google chrome wont support Ajax. Thanks, Ashish

更多推荐

UpdatePanel问题.第一次使用“更新"面板AJAX

本文发布于:2023-10-12 21:36:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1485967.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:面板   UpdatePanel   quot   AJAX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!