Asp.net 2.0 Web.config Custom Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring customerrors mvc developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask customerrors redirectmode Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join
Home > Tech Hub > How To Set Up Custom Error Pages In IIS 7.5 With ASP.NET How To Set Up Custom Error Pages In IIS 7.5 With ASP.NET by Jamie Furr on June 21, 2012 This blog post http://www.sherweb.com/blog/how-to-create-custom-error-pages-in-iis-7-5-with-asp-net/ will explain how to configure custom error pages in IIS (Internet Information Server). For this example we will be using IIS 7.5 which shipped with Windows Server 2008 R2. If we configure .NET Error Pages at the http://www.serverintellect.com/support/programming/custom-errors/ site level, ASP.NET stores the settings in the site's web.config file. Since these settings are stored in the web.config file they are portable and can be easily moved to another server with the site's content. How to customerrors mode setup Custom Error Pages in IIS 7.5 Open Internet Information Services (IIS) Manager. Select your website. Note: This could also be set at the server level and applied to all sites on the server. DoubleClick on the ".NET Error Pages" icon. The .NET Error Pages features view will be displayed. Click the "Edit Feature Settings" link to enable this feature. The "Edit Error Page Settings" dialog box will appear. In order to customerrors mode= on change the default mode, we must also specify a "Default Page". This page will be used for all status codes that are not otherwise defined. In our example we are using a generic custom error page to trap all other errors. Once you enter the absolute URL for the default error page click OK. Note: It may be a good idea to use a static HTML page here just in case ASP.NET is not functioning properly. By default server errors are shown when logged on locally to the IIS server and custom errors will only be used from remote sessions. We will want to change this to "On" if we are logged on locally to the IIS server. Otherwise, it will display detailed server errors, and not our custom error pages. Next we will explicitly define the 404 Error code. To get the browser to throw a 404 error, we pointed it to a file on the test site that does not exist. As you can see in the following image the friendly HTTP 404 error page was shown in IE9. A friendly HTTP 404 Error in IE9: On the .NET Error Pages Actions menu click the Add link. The "Add Custom Error Page" dialog will appear. This is where we define individual error pages per status code. For our ex
     (4678) Managed ServersManaged AzurePrivate CloudsServiceFirst Support Support Knowledge Base Service First Service Level Agreement Contact Us Managed Services Server Administration Security Services Monitoring Services Compare Services Company Who Are We? About Us Meet The Team Data Centers Certifications Awards & Accolades Unity Control Panel Connect Contact Us Server Intellect Reviews Connect Blog Legal ServiceFirst Knowledge Base SLA Unity Control Panel Contact Us Get Help Now! Get Expert Help! Get help from a Microsoft Certified Engineer. Connect Now Need Help ? Intellect ConnectHome / Intellect Connect / Disable ASP.NET Custom Errors in Web.Config Technical problem with your Windows Hosting? Let our Microsoft Certified experts handle the problem for you. Chat Now Disable ASP.NET Custom Errors in Web.Config Many times during the processing of an ASP.NET application, you will get the following runtime error. This is a generic error generated by ASP.NET When customErrors are set to ON. To resolve this issue, create a web.config file if one is not already present in your C:/Inetpub/wwwroot/yourdomain directory. Once you've located/created web.config edit the lines containing the