当前位置:编程学习 > C#/ASP.NET >>

在表单上想实现RadioButton选中后,改变DropDownList是否可选择

在表单上想实现RadioButton选中后,改变DropDownList是否可选择,如何实现? --------------------编程问答-------------------- 不明觉历 --------------------编程问答-------------------- 就判断哪个radioButton的选择状态为True的时候DropDownList.Enabled=true就OK了呗! --------------------编程问答-------------------- 在RadioButton的CheckedChanged事件中写,如果checked == true, DropDownList.Enabled=true --------------------编程问答--------------------


public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
    {
        DropDownList1.Enabled = true;
    }
    protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
    {
        DropDownList1.Enabled = false;
    }
}
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,