当前位置: 代码迷 >> ASP.NET >> 能不能先进行alert后再Redirect页解决方案
  详细解决方案

能不能先进行alert后再Redirect页解决方案

热度:6155   发布时间:2013-02-25 00:00:00.0
能不能先进行alert后再Redirect页
代码如下
if(Session[ "UserNamm "]==null)
{
Response.Write( " <script> window.alert( '登陆后才能回贴!请先登陆 '); </script> ");
Response.Redirect( "Login.aspx ");
return;
}
我想实现的功能就是,如果未登陆就不能回贴,可是实际上运行起来没有提示就直接转到“login.aspx”了.不知道是怎么回事???

------解决方案--------------------------------------------------------
if(Session[ "UserNamm "]==null)
{
Response.Write( " <script> window.alert( '登陆后才能回贴!请先登陆 ');window.location.href= 'Login.aspx '; </script> ");


}
  相关解决方案