我创建了一个简单的单选按钮列表。我写了简单的函数来做一些选择
这是单选按钮列表
<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;
}
}
但它不会触发任何事情。我究竟做错了什么?