更新面板中单选按钮列表的问题 [英] problem with radiobuttonlist in update panel

查看:69
本文介绍了更新面板中单选按钮列表的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在更新面板中有单选按钮列表.

radiobutton_selectchanged事件不会触发.

i have radiobuttonlist with in update panel.

radiobutton_selectchanged event are not fired.

<asp:Panel ID="SelectAttributesPanel" runat="server" Width="230px" BackColor="#F0F8FF" BorderColor="Black" BorderWidth="1" Font-Names="Verdana" Font-Size="X-Small" >
 <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
 <ContentTemplate>
                                        <asp:RadioButtonList ID="rdbRemarks" runat="server" RepeatDirection="Horizontal"

AutoPostBack="True">
<asp:ListItem Value="F1">Accept</asp:ListItem>
<asp:ListItem Value="F1">Objection Clear</asp:ListItem>
<asp:ListItem Value="F4">Objection</asp:ListItem>
<asp:ListItem Value="R">Reject</asp:ListItem>
 </asp:RadioButtonList>
 </ContentTemplate>
 <Triggers>
 <asp:AsyncPostBackTrigger ControlID="rdbRemarks" EventName="SelectedIndexChanged" />
 </Triggers>
 </asp:UpdatePanel> </asp:Panel>

推荐答案

单选按钮中缺少 OnSelectedIndexChanged="radiobutton_selectchanged"
You are missing OnSelectedIndexChanged="radiobutton_selectchanged" in the radio button
<asp:radiobuttonlist id="rdbRemarks" runat="server" AutoPostBack="True" repeatdirection="Horizontal" OnSelectedIndexChanged="radiobutton_selectchanged ">
    <asp:listitem value="F1">Accept</asp:listitem>
    <asp:listitem value="F1">Objection Clear</asp:listitem>
    <asp:listitem value="F4">Objection</asp:listitem>
    <asp:listitem value="R">Reject</asp:listitem>
</asp:radiobuttonlist>

后面的代码也必须定义此处理程序

also the code behind must have this handler defined

protected void radiobutton_selectchanged(object sender, EventArgs e)
    {

    }


您的所有代码几乎正确,但是您错过了单选按钮列表中onselectedindexchanged事件,因此在设计页面的单选按钮列表中首先双击事件,以便在后端生成radiobutton_selectchanged代码,然后检查....
Your All Code is almost right but u missing onselectedindexchanged events in radio button list so first double click events in radio button list in your design page so it generate radiobutton_selectchanged in back end code then check ….


这篇关于更新面板中单选按钮列表的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆