Response.Redirect ("indexp.aspx")在跳转时没有反应

不知道为什么,将Response.Redirect ("indexp.aspx")放在页面的什么地方都不进行跳转了,只是登陆页面闪了一下,之前还是跳转的,改动一些代码就这样了。

 if (pn.IsExit())
        {
            Session["PName"] = UName.Text.Trim();
            Session["PWD"] = PWD.Text.Trim();
            if (Person.Checked)
            { Response.Redirect("indexp.aspx"); }
            if (Company.Checked)
            {
                Response.Redirect("indexc.aspx");
            }
        }
        else
        {
            Response.Write("<script>alert('用户名或密码错误')</script>");
            return;
        }
            跪求,一下午都在纠结了,如果还是不知道是怎么回事,就无法进行了。

redirect后加个Response.End();试试

调试下,看你几个if走进去了没有