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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:57:58+00:00 2026-05-24T09:57:58+00:00

I am trying to configure an ErrorController in my .NET MVC application, and I

  • 0

I am trying to configure an ErrorController in my .NET MVC application, and I am unable to hit any actions on the controller currently, so I believe it may be because I need to register the URL route in the global.asax

The Error controller is the following:

public class ErrorController: Controller
{

    /*Default Redirect Error Page*/
    public ActionResult Index()
    {
        return View();
    }
    /*Generic Error Page*/
    public ActionResult Generic()
    {
        return View();
    }
    /*Status Code: 400*/
    public ActionResult NotFound()
    {
        return View();
    }
}

I would like to be able to call the actions above by the following URL’s respectively.

~/Error/
~/Error/Generic
~/Error/NotFound

I would believe that in the Global.asax file I would need to register these routes using something like the following:

routes.Add(new Route("error/{action}", new MvcRouteHandler())){controller = "Error", action = "";

How would I add/specify the correct route handler for this?

  • 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-24T09:57:59+00:00Added an answer on May 24, 2026 at 9:57 am

    I believe that the default url provided in global.asax would work for your url but if you want a specific url then go for:

    routes.MapRoute(
          "Error", // Route name
          "error/{action}", // URL without parameters
           new { controller = "Error", action = "Index" }, // Parameter defaults
    );
    

    and if you want parameters:

    routes.MapRoute(
          "Error", // Route name
          "error/{action}/{param}", // URL with parameters
           new { controller = "Error", action = "Index", param = UrlParameter.Optional }, // Parameter defaults
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently trying to configure an ASP.net Web Application through Web.config, to host
I'm trying to configure a dedicated server that runs ASP.NET to send mail through
I'm trying to configure an ejb3 sample application, it's entities where mapped to postgres
I am trying to configure NHibernate on my console application in which I am
I am currently trying to configure a routing option in Symfony2 so /cms will
I am trying to configure maven I am getting the following error https\://maven.java.net/content/groups/public/.error=Could not
I am trying configure a Django application to use mysql. I want to use
Trying to configure Jenkins CI. Currently just running it from the .war (eventual intention
Trying to configure NUnit 2.5.8.10295 in Cruise Control.NET on Windows Server 2008 R2, .NET
I'm trying to configure a web application that can use client-side JavaScript for localization

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.