Solved

How do I suppress Errors completely?

Posted on 2007-11-19
2
357 Views
Last Modified: 2013-12-17
Hi everyone,
I'm trying to suppress .net error messages from the client browser for security reasons (ie. I want as little info displayed).
I have modified the global.asax application_error method to redirect to a simple html page.  However,some errors are still showing typical .net error messages.  A cross site scripting error will show typical .net messages instead of redirecting.
The customErrors mode is set to "On" in my webconfig, but I would like it so that ALL errors get redirected to my html page.
How do I do that?
0
Comment
Question by:web_ohh
2 Comments
 
LVL 4

Accepted Solution

by:
rallsaldo earned 250 total points
ID: 20315151
Hi,

Try adding a CustomErrors Section to your Web.Config. You can specify a page for all errors such as:

<customErrors defaultRedirect="MainErrorPage.aspx" mode="On"/>

or have more specific page redirects depending on error:

<customErrors defaultRedirect="MainErrorPage.aspx" mode="On">  
   <error statusCode="404" redirect="FileNotFoundError.aspx" />
    <error statusCode="403" redirect="AccessDeniedError.aspx" />
</customErrors>

Hope that helps,
R
0
 

Author Comment

by:web_ohh
ID: 20315343
Awesome.  It worked AND my custom logging is still working as well.
Thanks rallsaldo,
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video teaches users how to migrate an existing Wordpress website to a new domain.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question