asp.net mvc 中如何取RadioButton的值

2024-12-16 17:04:36
推荐回答(1个)
回答1:

Protected void Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
{
RadioButton1.AutoPostBack = True; //让RadioButton响应服务端事件.
RadioButton2.AutoPostBack = True;
.....
}

Protected void RadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
{
变量 = 0;
}

Protected void RadioButton2_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs)
{
变量 = 1;
}