Solved

How do I suppress Errors completely?

Posted on 2007-11-19
2
358 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

A Change in PHP Behavior with Session Write Short Circuit (http://php.net/manual/en/book.session.php#116217) (Winter 2014)** With the release of PHP 5.6 the session handler changed in a way that many think should be considered a bug.  See the note …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

839 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