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

  • Home
  • SEARCH
  • 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 8162697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:48:55+00:00 2026-06-06T18:48:55+00:00

I am trying to follow the examples in this link and this one but

  • 0

I am trying to follow the examples in this link and this one but instead of showing the error page I get an HTTP 500 Internal server error.
I have the <customErrors mode="On" /> set in the webconfig. I have even tried applying the [HandleError] filter to the controller class. I tried without as well. The Error.aspx is present in /Views/Shared/ as well so it couldn’t be a case of no file found.

I threw a DivideByZero exception in my controller’s action method. I want to follow that example so that I can specify a separate error page for all the actions that need them.

I am using the aspx view engine in a blank project that I created. That should not be the reason for it right?. I am also using a master page for this. Anything that I could be missing?

Thanks

Edit-Added Code

I added this code to a new project and made the web.config entry <customErrors mode="On" />

 [HandleError]
    public class HomeController : Controller
    {
        //
        // GET: /Home/
        [HandleError]
        public ActionResult Index()
        {

            throw new DivideByZeroException();
            return View();
        }

    }

It didnt work! Then I commented that DivideByZeroException and in the aspx view just added and invalid Model.Property. In both instances I got the Internal server error. I have done everything there is to be done as per documentation. I see a lot of other people having the same problem and not being able to solve it too. Is this a bug in MVC 3?

  • 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-06-06T18:48:58+00:00Added an answer on June 6, 2026 at 6:48 pm

    I think I have figured out what really was the problem. My main Home page index was in a master page. I added the same master page to the default error page that comes out of the box with Visual Studio and it worked for me.

    The documentation needs to point out more clearly this important requirement,… if it indeed is one.

    Another amazing revelation is that you don’t need to decorate your controller classes with the [HandleError] attribute. It works without that as well for the default Error view. You may provide that attribute if you want a specific custom view for your action or controller.
    Like so:

    [HandleError(View = "CustomError")]
    

    …where CustomError.aspx is just another plain aspx view page in either the shared folder for the View or in the View-Controller folder itself.

    Has anyone got this working without putting the error pages in a master page, where the main calling page that throws the error is in a master page?

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

Sidebar

Related Questions

I was basically trying to follow http://www.building58.com/examples/tabSlideOut.html tutorial and I'm having that error, what
I'm a newbie to sql and am trying to follow this example here: http://net.tutsplus.com/tutorials/php/a-better-login-system/
I am new to maven and I am trying to follow this example but
Trying to follow some basic examples and getting stuck by this code that is
I'm trying to follow Lazy Foo's tutorials. But when I try to run one
Trying to follow this example. (Section String sorting...) Is there anything obvious that would
I am trying to follow this example (from p137 of Rob Pickering's Foundations of
I’ve been trying to follow some examples for uploading data to a website. I
I'm trying to follow the example on http://developers.cloudmade.com/wiki/iphone-sdk/Create_basic_Local_Search_and_Geocoding_app . The example from svn provided
I'm having a problem with JQGrid using ASP.NET MVC. I'm trying to follow this

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.