日期:2014-05-18  浏览次数:20404 次

C# 语句 执行顺序问题 怎样控制? 谢谢!
if (Session["userName"] == null)
  {

  Response.Write("<script>alert('对不起,只有会员才能发布请先登录或免费注册')</script>");
  Response.Redirect("register.aspx");
  }
 
这个语句直接跳转了 没有弹出提示信息! 怎样控制它先提示信息 再跳转啊? 望高手指点!谢谢!

------解决方案--------------------
if (Session["userName"] == null) 


Response.Write(" <script> alert('对不起,只有会员才能发布请先登录或免费注册');location='register.aspx' </script> "); 


------解决方案--------------------
Response.write("<script>alert('对不起,只有会员才能发布请先登录或免费注册');window.open('register.aspx','_self')</script>");
------解决方案--------------------
JScript.AlertAndRedirect("对不起,只有会员才能发布请先登录或免费注册'!", "register.aspx");
------解决方案--------------------
探讨
JScript.AlertAndRedirect("对不起,只有会员才能发布请先登录或免费注册'!", "register.aspx");

------解决方案--------------------
if (Session["userName"] == null) 


Response.Write(" <script> alert('对不起,只有会员才能发布请先登录或免费注册');window.open('register.aspx','_self') ; </script> "); 
}
------解决方案--------------------
Response.Write("<script>alert('对不起,只有会员才能发布请先登录或免费注册');window.location.href='Default4.aspx';</script>")