谁能给个ASP.net判断登陆的简单例子及说明!

解决方案 »

  1.   

    if(Session["login_id"]==null)  //判断用户Session
    {
    HttpContext.Current.Session["returnPage"]=HttpContext.Current.Request.RawUrl;
    this.Response.Redirect("login.aspx");   
    }
    else
    {
    //这里如果已经登陆了应该如何
    }在login.aspx页面this.Response.Redirect(HttpContext.Current.Session["returnPage"].ToString());
      

  2.   

    http://www.codeproject.com/aspnet/formsroleauth.asp
      

  3.   

    http://msdn.microsoft.com/library/CHS/cpguide/html/cpconASPNETAuthentication.asp?frame=true
      

  4.   

    不要Session这种方法判断!这应该是ASP的吧!
      

  5.   

    HttpContext.Current.Session["returnPage"]=HttpContext.Current.Request.RawUrl;???这是干什么的阿?
      

  6.   

    不要session的,,那就用cookie的,,,,再不然就用asp.net提供的身份认证,,,不过也是用cookie 的
      

  7.   

    即便是很简单,也不是十几行代码就可以的,网上很多这样的例子,找个看看
    或者看MSDN关于FORM认证节