Microsoft Knowledge Base Email Alertz

KBAlertz.com: You receive a default error message when you set custom errors in a Web application that is built on the .NET Framework

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 2.0 Web Hosting with SQL 2005: Click Here!
Discount ASP.NET Hosting


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




You receive a default error message when you set custom errors in a Web application that is built on the .NET Framework

Article ID:910434
Last Review:February 10, 2006
Revision:1.1

SYMPTOMS

When you run a Web application that is built on the Microsoft .NET Framework, you may unexpectedly receive the following generic error message even though you specified a custom error page in the Web.config file:
Server Error in '/deneme1' Application.
--------------------------------------------------------------------------------

Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed.

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".
<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly"/>
    </system.web>
</configuration>
Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.
<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="On" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

Back to the top

CAUSE

This issue occurs when a custom error page in the application also contains an error.

Back to the top

RESOLUTION

To resolve this issue, specify one of the following pages as the custom error page for the application:
A static page
A page that exists outside the application

Back to the top

STATUS

This behavior is by design.

Back to the top

MORE INFORMATION

Custom error pages in Web applications that are built on the .NET Framework are displayed only if the mode value of the customErrors element in the Web.config file is set to On or RemoteOnly.

For example, you can use the following code in the Web.config file.
<configuration>
    <system.web>
        <customErrors mode="RemoteOnly"/>
    </system.web>
</configuration>
For more information about how to create custom error pages in Microsoft ASP.NET, click the following article numbers to view the articles in the Microsoft Knowledge Base:
308132 (http://kbalertz.com/Feedback.aspx?kbNumber=308132/) How to create custom error reporting pages in ASP.NET using Visual Basic .NET
306355 (http://kbalertz.com/Feedback.aspx?kbNumber=306355/) How to create custom error reporting pages in ASP.NET by using Visual C# .NET

Back to the top


APPLIES TO
Microsoft ASP.NET 1.1
Microsoft ASP.NET 1.0

Back to the top

Keywords: 
kbprb KB910434

Back to the top

       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Godly Reported as Irrelevant  
Written: 6/6/2006 7:58 AM
Thnx.. it makes sense. Now I have to get that static page linked and all the problems of the world will be gone!

nitin - nitinnil NOSPAM-AT-NOSPAM gmail.com Reported as Irrelevant  
Written: 7/13/2006 10:13 AM
I'm not getting the file weg.config will u plz tell me the detail of that error . the error syntax is seems such as "To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please