protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
             if (Request.Cookies["manage"] == null)
                {  
            //重置路由吧算是 filterContext.Result
= RedirectToRoute("default", new { Controller = "Land", Action = "Index" });          } base.OnActionExecuting(filterContext); }

 

在网上看到其他的解决方案:

filterContext.HttpContext.Response.Redirect("")
//只需要加上
filterContext.Result = new HttpUnauthorizedResult()
//或者
filterContext.Result = new EmptyResult()
//filter验证不通过就不会执行action了,

 

posted on 2013-09-23 17:14  mrma1989  阅读(484)  评论(0编辑  收藏  举报