Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. 404 Custom Error Messages

404 Custom Error Messages

Scheduled Pinned Locked Moved ASP.NET
csharphelpasp-netquestion
3 Posts 2 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    imnotso
    wrote on last edited by
    #1

    I want to catch 404 page not found errors in my C# ASP.net 2.0 website. So I put........... <customErrors mode="On" defaultRedirect="UnexpectedError.aspx"> <error statusCode="404" redirect="PageNotFound.aspx"/> </customErrors> in my web config file, great. If I change the URL in the browser from www.mysite.homepage.aspx to www.mysite.omepage.aspx my pagenotfound page displays. whats the problem?? If i change it to www.mysite.homepage.spx I get a standard 404 error but no custom page, is this not a real 404? Any clues?? Harvey

    V 1 Reply Last reply
    0
    • I imnotso

      I want to catch 404 page not found errors in my C# ASP.net 2.0 website. So I put........... <customErrors mode="On" defaultRedirect="UnexpectedError.aspx"> <error statusCode="404" redirect="PageNotFound.aspx"/> </customErrors> in my web config file, great. If I change the URL in the browser from www.mysite.homepage.aspx to www.mysite.omepage.aspx my pagenotfound page displays. whats the problem?? If i change it to www.mysite.homepage.spx I get a standard 404 error but no custom page, is this not a real 404? Any clues?? Harvey

      V Offline
      V Offline
      Vasudevan Deepak Kumar
      wrote on last edited by
      #2

      imnotso# wrote:

      This is in the application web.config processed by ASP.NET. Hence 404s that can be trapped from within the application which are ASP.NET parseable files alone get through this filter. Everything else passes through the standard IIS 404 filter, which you may need to configure or have all requests routed through ASP.NET, which might increase the load on ASP.NET.

      Vasudevan Deepak Kumar Personal Homepage
      Tech Gossips
      A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

      I 1 Reply Last reply
      0
      • V Vasudevan Deepak Kumar

        imnotso# wrote:

        This is in the application web.config processed by ASP.NET. Hence 404s that can be trapped from within the application which are ASP.NET parseable files alone get through this filter. Everything else passes through the standard IIS 404 filter, which you may need to configure or have all requests routed through ASP.NET, which might increase the load on ASP.NET.

        Vasudevan Deepak Kumar Personal Homepage
        Tech Gossips
        A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson

        I Offline
        I Offline
        imnotso
        wrote on last edited by
        #3

        That's great, thanks

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups