我试过,没有问题的
我没有用RadioButtonList1_SelectedIndexChanged这个,不知道这个事件你写的是什么代码
前台代码:
登录:
protected void LoginButton_Click(object sender, EventArgs e)
{
if (RadioButtonList1.SelectedIndex == 0)
{
Response.Redirect("Student.aspx");
}
else if (RadioButtonList1.SelectedIndex == 1)
{
Response.Redirect("Teacher.aspx");
}
else if (RadioButtonList1.SelectedIndex == 2)
{
Response.Redirect("Admin.aspx");
}
}
你应该是这样的
protected void LoginButton_Click(object sender, EventArgs e)
{
if (RadioButtonList1.SelectedValue == "1")
{
Response.Redirect("Student.aspx");
}
else if (RadioButtonList1.SelectedValue == "2")
{
Response.Redirect("Teacher.aspx");
}
else if (RadioButtonList1.SelectedValue== "3")
{
Response.Redirect("Admin.aspx");
}
}
“省略了判断的语句,直接跳转”,什么意思??
值得深入研究