Response.Write("<script>alert('注册成功')</script>");
Response.Redirect("../Qw_infodetail.aspx?fr_id="+Session["fr_id"].ToString());如上,为什么有了Response.Redirct 后
Response.Write("<script>alert('注册成功')</script>");就不执行了,也就是不弹出注册成功的确认窗口了。另外有办法使得Response.Redirect是弹出新窗口吗?
Response.Redirect("../Qw_infodetail.aspx?fr_id="+Session["fr_id"].ToString());如上,为什么有了Response.Redirct 后
Response.Write("<script>alert('注册成功')</script>");就不执行了,也就是不弹出注册成功的确认窗口了。另外有办法使得Response.Redirect是弹出新窗口吗?
window.location.href='../Qw_infodetail.aspx?fr_id="+Session["fr_id"].ToString()+"'"
</script>");
你可以考虑传递参数到Qw_infodetail.aspx页面里面,在这个页面alert。==》另外有办法使得Response.Redirect是弹出新窗口吗?
Response.Write("<script>window.open(....)</script>");
服务端代码先执行,所以只能用输出的javascript执行转向
正确的做法:
Response.Write("<script>alert('注册成功')</script>");
Response.Write("<script>window.location.href='../Qw_infodetail.aspx?fr_id="+Session["fr_id"].ToString()+"'"
</script>");