Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6178593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:28:55+00:00 2026-05-24T00:28:55+00:00

Using the following error handling in Application_Error(): protected void Application_Error() { Exception exception =

  • 0

Using the following error handling in Application_Error():

    protected void Application_Error()
    {
        Exception exception = Server.GetLastError();
        Response.Clear();

        HttpException httpException = exception as HttpException;

        if (httpException != null)
        {
            string action;

            switch (httpException.GetHttpCode())
            {
                case 404:
                    // page not found
                    action = "HttpError404";
                    break;
                case 500:
                    // server error
                    action = "HttpError500";
                    break;
                default:
                    action = "General";
                    break;
            }

            // clear error on server
            Server.ClearError();

            Response.Redirect(String.Format("~/Error/{0}/?message={1}", action, exception.Message));
        }
    }

Prior to adding this, my pages rendered fine. Now that I’ve added this, I’m getting about 21 file not found exceptions. I initially thought that some routing values were wrong (but they don’t execute until you try the route), commented them out, same thing.

I stepped through the initial page load up, and since the entire page renders at once, once, I wasn’t able to trace down where these are coming from, and the stacktrace doesn’t give me what I’m looking for:

at System.Web.StaticFileHandler.GetFileInfo(String
virtualPathWithPathInfo, String physicalPath, HttpResponse response)
at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext
context, String overrideVirtualPath) at
System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context,
AsyncCallback callback, Object state) at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously)

I thought that maybe this was occurring where the CSS and scripts are defined, but commenting these out did nothing to fix the issue.

How can I track this down?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:28:56+00:00Added an answer on May 24, 2026 at 12:28 am

    I bet 5 bucks it’s the favicon.ico file that some browsers request and which you didn’t provide. Inside your error handler simply look at Request.Url property in Debug mode to see the requested url and you will know which file is missing. Also if you intend to redirect at the end of your error handler as you do, calling Server.ClearError(); doesn’t make much sense.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following snippet (error handling missing on purpose): void* foo(const char *path, off_t
Using YUICompressor I get the following error from my javascript code: [ERROR] 270:201:missing name
I am getting following error message when using Doctrine ORM in Codeigniter. ( !
I'm getting the following error in Eclipse using the Cusp plug-in: Package LISP-UNIT is
Using HttpClient , I receive the following error when attempting to communicate over HTTPS:
I am using following PHP code for trigger creation but always get error, please
Using the Venkman JavaScript debugger for Mozilla and getting the following error: XML Parsing
I am getting the following error: Access denied for user 'apache'@'localhost' (using password: NO)
I'm getting the following error when trying to build my app using Team Foundation
I get the following error when I try to compile an asp.net site using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.