Three ways to share an ASP. 404 error jump to a specified page
Method one: Web. config configuration
- 1 First double-click the "Web. config" file in the Open project
Find the system.web node, add mode on the CustomErrors node, and replace the "404.html" in the diagram with the file path name you need, (if not, please add it manually, the code has smart tips, it is easy to add)
Once recompiled, it jumps to the specified page.
Method Two: Global.asax configuration
Also found in the project and double-click to open the "Global.asax" file
Adding code to the "Application_Error" method also requires recompiling to see the effect, Step 3 of the reference method
Method Three: IIS configuration
Open your "IIS Manager", right click on your website project, find the "Properties" menu in the popup right-click menu, we take "WebClient" project as an example
The Properties window for the WebClient project pops up, finds and opens the Custom Errors tab, finds "404" in the HTTP error message list, and then clicks the Edit button
In the "Edit Custom Error Properties" window that pops up in the "File" input box, modify the file path name you need, then click OK button to finish setting, then restart the IIS service to see the effect
ASP. 404 error jump to specified page