![](/img/trans.png)
[英]ASP.Net MVC View with RadioButtonList with Other freeformat selection
[英]asp.net radiobuttonlist doesnt fire on selection
我创建了一个简单的单选按钮列表。 我写了简单的函数来做选择
这是单选按钮列表
<asp:RadioButtonList ID="payment_type" CssClass="rbl_type" runat="server" TextAlign="Right" RepeatDirection="Horizontal" BorderStyle="None" OnSelectedIndexChanged="payment_type_SelectedIndexChanged">
<asp:ListItem Value="0">Serbest Ödeme</asp:ListItem>
<asp:ListItem Value="1">Ön Tanımlı Ödeme</asp:ListItem>
</asp:RadioButtonList>
这是C#代码
protected void payment_type_SelectedIndexChanged(object sender, EventArgs e)
{
if (payment_type.SelectedValue == "0")
{
pnl_serbest.Visible = true;
pnl_on_tanimli.Visible = false;
}
else
{
pnl_serbest.Visible = false;
pnl_on_tanimli.Visible = true;
}
}
但它不会触发任何东西。 我究竟做错了什么?
加
AutoPostBack="true"
属性设置为<asp:RadioButtonList />
标记。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.