Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.HttpMethod == "POST")
            {
                UserLogin();//用户登录
            }
            else //get请求
            {
                if (!string.IsNullOrEmpty(Request["returnUrl"]))
                {
                    ReturnUrl = Request["returnUrl"];
                }

                //判断Session中是否有值
                if (Session["userInfo"] != null)
                {
                    Response.Redirect("/UserInfoManager/UserCenter.aspx");
                }
                if (Request.Cookies["cp1"] != null)
                {
                    string     userName = Request.Cookies["cp1"].Value;
                    Model.User userInfo = userManager.GetModel(userName);
                    if (WebCommon.CheckCookieInfo(userInfo))
                    {
                        Response.Redirect("/UserInfoManager/UserCenter.aspx");
                    }
                }
            }
        }