asp.net+jquery ajax无刷新登录的实现方法(2)


protected void Page_Load(object sender, EventArgs e)
        {
            string username = Request.Form["UserName"];
            string userpass = Request.Form["UserPass"];
            T_User user = UserManager.loginpassword(username, userpass);
            if (user != null)
            {
                Session["user"] = user;
                Response.Write("1");  //登录成功
                Response.End();

            }
            else
            {
                if (UserManager.OnlyOne(username) >= 1)
                {
                    Response.Write("2");  //密码不正确
                    Response.End();
                }
                else
                {
                    Response.Write("3");  //用户名不存在
                    Response.End();
                }
            }
        }

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjgjfy.html