且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在按钮单击时禁用单选按钮?

更新时间:2022-03-12 01:24:00

在您的代码中,您有以下内容..........





in your code where you have the following..........


protected void drpLType_SelectedIndexChanged(object sender, EventArgs e)
{
    if (drpLType.SelectedValue == "Professional")
    {
        rdoMeapSupport.Enabled = true;
    }

    if (drpLType.SelectedValue == "Enterprise")
    {
        rdoMeapSupport.SelectedValue = null;
        rdoMeapSupport.Enabled = true;
    }

    if ((drpLType.SelectedValue == "Maintanence") || (drpLType.SelectedValue == "Reporting"))
    {
        rdoMeapSupport.Enabled = false;
        rdoMeapSupport.ClearSelection();
    }

}







不应该...... ...........






Shouldnt that be.............

protected void drpLType_SelectedIndexChanged(object sender, EventArgs e)
{
    if (drpLType.SelectedValue == "1")
    {
        rdoMeapSupport.Enabled = true;
    }

    if (drpLType.SelectedValue == "2")
    {
        rdoMeapSupport.SelectedValue = null;
        rdoMeapSupport.Enabled = true;
    }

    if ((drpLType.SelectedValue == "3") || (drpLType.SelectedValue == "4"))
    {
        rdoMeapSupport.Enabled = false;
        rdoMeapSupport.ClearSelection();
    }

}







原因是你有明确定义的VALUE =1值=2等




The reason for this is you have CLEARLY defined VALUE="1" value="2" etc