1.Add following in web.config under the system.web
<system.web>
<customErrors defaultRedirect="~\HttpErrorPage.aspx" mode="On">
</customErrors>
</system.web>
2.Add following into IIS infocenter web site.
-Go to InfoCenter site in IIS
-Double Click on Error Pages icon in Features View.
-Right Click “Add”
-Tick the Execute a URL on this site and the path as “/Virtual Folder name of the site/HttpErrorPage.aspx”
-Click OK.
-When you adding these configurations will added in to web config file automatically so you may need to accept the changes and save it.
So likewise you can add multiple pages for different Http errors etc:- 403,402,401,501..
Test: generate a 404 error,it will take you to the custom error page
Ex:- localhost\sitename\balalala.aspx
No comments:
Post a Comment