string str = "<script>\n alert('提交成功');\n </script>";
this.page.RegisterStartupScript("aa",str);
Response.Redirect("xx.aspx")
为什么提示框没有出来,就直接执行下一句?有没有好的解决办法?
this.page.RegisterStartupScript("aa",str);
Response.Redirect("xx.aspx")
为什么提示框没有出来,就直接执行下一句?有没有好的解决办法?
Server.Transfer("",false);
Response.Write("<script LANGUAGE=JavaScript >"+
" alert('该用户不存在,请先注册!');"+
" window.location=('agreement.aspx');"+
"</script>");
Response.Redirect("xx.aspx",false)
写在一起才有效
这样作:
string str="<script>"+"alert('"+"您此项权限尚未开通,无法进入!"+"');"+"self.location.href='desktop_new.aspx';"+"</script>";
Response.Write(str);
alert("");
document.localation=".....aspx"
---------------------------------
上面的说法完全正确,也就是说Response.Redirect是服务器执行的,但是alert是客户端执行的。你的alert并没有被传递给客户端,因为在服务器你的页面已经被Redirect
alert 在 Response.Redirect 的前面为什么对话框还没出来,就重定向了(不要笑我,也不要骂我)