BVNetwork.NotFound.Core.NotFoundPage.NotFoundPageAttribute.OnActionExecuting C# (CSharp) Method

OnActionExecuting() public method

public OnActionExecuting ( System.Web.Mvc.ActionExecutingContext filterContext ) : void
filterContext System.Web.Mvc.ActionExecutingContext
return void
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            if (!PageEditing.PageIsInEditMode)
            {
                Log.Debug("Starting 404 handler action filter");
                var request = filterContext.HttpContext.Request;
                filterContext.HttpContext.Response.TrySkipIisCustomErrors = true;
                int statusCode = NotFoundPageUtil.GetStatusCode(request);
                filterContext.HttpContext.Response.StatusCode = statusCode;
                string status = NotFoundPageUtil.GetStatus(statusCode);
                if (!string.IsNullOrEmpty(status))
                {
                    filterContext.HttpContext.Response.Status = status;
                }
                NotFoundPageUtil.SetCurrentLanguage(filterContext.HttpContext);
                filterContext.Controller.ViewBag.Referrer = NotFoundPageUtil.GetReferer(request);
                filterContext.Controller.ViewBag.NotFoundUrl = NotFoundPageUtil.GetUrlNotFound(request);
                filterContext.Controller.ViewBag.StatusCode = statusCode;
            }
        }