BVNetwork.NotFound.Core.Custom404Handler.FileNotFoundExceptionHandler C# (CSharp) Method

FileNotFoundExceptionHandler() public static method

public static FileNotFoundExceptionHandler ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        public static void FileNotFoundExceptionHandler(object sender, EventArgs e)
        {
            HttpContext context = GetContext();
            if (context == null)
                return;
            if (CheckForException(context, context.Request.Url))
            {
                context.Response.Clear();
                context.Response.TrySkipIisCustomErrors = true;
                context.Server.ClearError();
                context.Response.StatusCode = 404;
            }
        }