标签:
登录时增加:
Session["UserName"] = model.UserName;
Controller:
protected override void OnActionExecuting(ActionExecutingContext filterContext) { base.OnActionExecuting(filterContext); //这里判断出没有登录然后进行跳转 if (this.Session["UserName"] == null) { Response.Redirect("/Account/Login"); } }
标签:
原文地址:http://www.cnblogs.com/gobuild/p/4919283.html