日期:2014-05-17  浏览次数:20412 次

asp.net 登录问题,验证问题(急)
别人的登录一点登录按钮, 他就会跳到一个空白的页面,然后有个提示框,说他验证失败,然后一点确认, 他又跳回原本的页面来了。

  他是怎样实现的阿? 有代码最好

------解决方案--------------------
C# code

...
if(验证失败)
{
        //登录失败,提示并跳转到登录页面
       ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>alert(/'登录失败!/');setTimeout(function(){location.href='Login.aspx'},1000);  </script>");
}
else
{
        //登录成功,提示并跳转到主页面
       ClientScript.RegisterClientScriptBlock(GetType(), "", "<script>alert(/'登录成功!/');setTimeout(function(){location.href='Main.aspx'},1000);  </script>");
}
...