【问题标题】:No reaction to RadioButtonList对 RadioButtonList 没有反应
【发布时间】:2014-05-02 11:39:49
【问题描述】:

我想根据在 RadioButtonList 中检查单选按钮来显示文本框,但没有显示任何更改。

protected void Page_Load(object sender, EventArgs e)
{
}

protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
    switch (RadioButtonList1.SelectedIndex)
    {
        case 2:
            TextBox3.Visible = true;
            goto case 1;
        case 1:
            TextBox2.Visible = true;
            goto case 0;
        case 0:
            TextBox1.Visible = true;
            goto default;
        default:
            break;
    }
}

【问题讨论】:

  • 你使用goto语句的目的是什么?

标签: asp.net webforms


【解决方案1】:

检查并设置 AutoPostBack="True"。

【讨论】:

    猜你喜欢
    • 2011-12-12
    • 1970-01-01
    • 2012-10-23
    • 2019-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-06
    • 2021-02-21
    相关资源
    最近更新 更多