Problem Description: By default, MVC has configured the routing parameter settings, which is not explained here, please go to the garden search, there are many related articles. This is about an MVC project in which we enter an incorrect URL, or a URL that doesn't exist at all, such as: Http://localhost:6224/jeutcvmg/jfidjfijdif, which appears to be a hard-to-see, very unfriendly error page. You want it to jump to the specified page, the default home page, and so on, and reach the global response.
Key words: customErrors
Solve the explanation
1. Open <web.config>, find <system.web> node, add under Node
<customErrorsMode= "On"defaultredirect= "~/home/error"> <ErrorStatusCode= "403"redirect= "~/home/unauthorizedaccess"/> <ErrorStatusCode= "404"redirect= "~/home/filenotfound"/> </customErrors>
2.mode has on, OFF, RemoteOnly and other modes, as the name implies; defaultredirect error default jump page routing;
Error when the project appears with the specified error code, the errors page is specified according to the route jump.
There are some other parameters, and then slowly groping it!
PS: Rookie Notes
ASP. NET MVC Error Routing default configuration