1.11.5.Custom Error Pages
public ActionResult About() { throw new Exception(); return View(); }<system.web> <!--<customErrors mode="RemoteOnly"></customErrors>--> <customErrors mode="On"> <error statusCode="404" redirect="~/404.html"/> </customErrors><!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> </head> <body> <h1>Not found</h1> </body> </html><system.webServer> <httpErrors errorMode="Custom"> <remove statusCode="404"/> <error statusCode="404" path="404.html" responseMode="File"/> </httpErrors>
Last updated