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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:30:17+00:00 2026-05-28T07:30:17+00:00

I have created an otherwise empty ASP.NET MVC 3 application with 2 controllers, HomeController

  • 0

I have created an otherwise empty ASP.NET MVC 3 application with 2 controllers, HomeController and OtherController.

HomeController.cs looks like this:

public class HomeController : Controller
{
    public ActionResult Index()
    {
        return View();
    }
}

Index.cshtml looks like this:

@Html.Action("Index", "Other")

And, of course, Othercontroller.cs:

public class OtherController : Controller
{
    [ChildActionOnly]
    public ActionResult Index()
    {
        return Content("OK!");
    }
}

So far, so good. I run the app, and it tells me everything is OK!

Now, I take the default RegisterRoutes from Global.asax.cs:

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            "Default", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
        );
    }

And I crumple it up, so that no routes match OtherController:

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute("Default", "", new { controller = "Home", action = "Index" });
    }

Now, when I run the page, it crashes with this error message:

 System.InvalidOperationException: No route in the route table matches the supplied values.
Source Error:
Line 1:  @Html.Action("Index", "Other")

I specified the controller name and action name in the call to .Action. No URLs are being generated, and no requests are being made. Why does routing even need to get involved?

  • 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-28T07:30:18+00:00Added an answer on May 28, 2026 at 7:30 am

    I think that this blog post will help you understand a little more:

    http://blogs.charteris.com/blogs/gopalk/archive/2009/01/20/how-does-asp-net-mvc-work.aspx.

    Essentially, routing is involved in determining which controller to ‘fire up’ to handle the request and appropriate action to invoke based on the parameters that you sent and the MVCRouteHandler uses those to make a decision. Just because you tell it which controller in your action does not make it magically ignore the routing table, go straight to that controller class and bypass all the other MVC goodness that happens in the back-end. Remember, these @HTML.Action methods can take a whole lot of overloads which could influence which route in the routing table to use (think URL structure for instance).

    The MVC paths are not to static content and as such, have to be parsed through the URLRoutingModule which uses the routing table to decide on what to do. Since you have no matching route – you get an error.

    EDIT

    In my diatribe, I did not actually address your final statement. You’re right, no URL was generated, but a request to the application was generated. HTML.Action still will use routing to determine what controller, action, area, parameters to use. I think it be fair to say in simple terms that it’s like generating an ActionLink and clicking it for you.

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

Sidebar

Related Questions

A have ASP.NET 2.0 web application that should allow sending emails. I have a
I have created a webservice in .net 2.0, C#. I need to log some
My problem i sthat i have created a web application in visual studio 2008
I'm curious how others address this issue. Using VSEWSS 1.3, I have created a
i have this problem: starting from an empty list (0 elements) i want check
I have created a program with a 30 day trial period in VB.Net. The
So basically I have a layout like this: <div id=header> <div id=elementAbsolute> <div id=headerElement1>
I have created a simple shopping cart application. We needed something specific to our
I have just created a new facebook application to use in a page tab.
Have created a c++ implementation of the Hough transform for detecting lines in images.

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.