刚刚写一段代码用RadioButton的Chceked属性控制DropDownList控件的Visible
void check_change(object sender, EventArgs e)
{
if(RadioButton1.Checked)
DropDownList1.Visible=false;
else if(RadioButton2.Checked)
DropDownList1.Visible=true;
}
运行后没有反应,后来发现RadioButton的AutoPostBack设置为False,此属性控制是否自动将控件状态发送到服务器,设为true后便能正常运行。
转载于:https://www.cnblogs.com/kirk003/archive/2006/03/15/350676.html