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 6922465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:24:34+00:00 2026-05-27T10:24:34+00:00

I am trying to serve a custom error page in an MVC2 app, which

  • 0

I am trying to serve a custom error page in an MVC2 app, which uses the ELMAH for error log (elmah)

I can’t seem to reference the page correctly.

The error page is located at ~/Views/Shared/Error.aspx

In the web.config :

<system.web>  
    <customErrors mode="On" defaultRedirect="~/Shared/Error.aspx"/>
</system.web> 

But when I cause an error, expecting the error page, I get:

The resource cannot be found.
Requested URL: /Shared/Error.aspx

smae result even if I modify defaultRedirect to ~/Views/Shared/Error.aspx

What am I doing wrong ?

edit: I obviously don’t want to redirect to an action. I just want to display a static generic error page.

  • 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-27T10:24:35+00:00Added an answer on May 27, 2026 at 10:24 am

    You should set defaultRedirect to the path of a route that renders your error page, e.g.

    defaultRedirect="/home/error"
    

    Or a static HTML error page, e.g.

    defaultRedirect="/error.html"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a custom transition, to serve as a replacement for a
I'm trying to serve a property list of search results to my iPhone app.
I'm trying to build a blog/messageboard that uses static HTML files to serve content.
We are trying to design 6 web services, which will serve another client component.
I'm trying to get the custom 404 page we've built to display instead of
I'm trying to display a custom error message if a method doesnt' exist as
I'm trying to setup custom error pages. I put the pages in /error/ in
I'm trying to implement a .NET Custom Validator that uses $.ajax to query a
I'm trying to run a custom WinHTTP based web-server on Windows Server 2008 machine.
So I am trying to serve large files via a PHP script, they are

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.