ActionFilterAttribute is an Action filtering class that is executed before an action is executed. actionFilterAttribute is a VC class that specifically processes action filtering. based on this principle, assuming an action: AdminIndex, the minimum access requirement for this Action is that the user must be logged on. then, we need to add a judgment public ActionResult AdminIndex () {return View ();} on the [CheckLogin ()] // above the Action ();} // end AdminIndex as mentioned above, ActionFilterAttribute is the filter base class, so CheckLogin () determines that it must inherit ActionFilterAttribute as follows: public class CheckLoginAttribute: ActionFilterAttribute {pub Lic CheckLoginAttribute () {}} // end class CheckLoginAttribute has an abstract in the ActionFilterAttribute base class when public abstract void OnActionExecuting (ActionExecutingContext filterContext ); as the name implies, it refers to what to do before an Action is executed. after the CheckLoginAttribute inherits the main class, the OnActionExecuting (..) for example, public override void OnActionExecuting (ActionExecutingContext filterContext) {}// end Action, we can write the processing we want to do in this method. for example, public override void OnActi OnExecuting (ActionExecutingContext filterContext) {// if the user has not logged on to if (! UserLogin. isLogined) {// processing method ErrorRedirect (filterContext); return;} // end if} www.2cto.com // error handling method private void ErrorRedirect (ActionExecutingContext filterContext) {filterContext. result = new RedirectToRouteResult ("Default", new RouteValueDictionary (new {controller = "Home", action = "Default"});} // end ErrorRedirect when the ErrorRedirect method is executed, it selects the specified Route and jumps to the Action of a non-AdminIndex.