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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:10:35+00:00 2026-05-21T15:10:35+00:00

I have a web project using ASP.net MVC3. There’s an child action in my

  • 0

I have a web project using ASP.net MVC3. There’s an child action in my project. I use

<% Html.RenderAction("Navigator", "Application");%>

to call a shared action. But I find that if my current url is “localhost/application”, it throws an exception “No route in the route table matches the supplied values”. But when current url is “localhost/application/index”, it works fine. Index is a default action in my route config, which is shown below:

    public static void RegisterRoutesTo(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
        routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
        //routes.IgnoreRoute("{*chartName}", new { chartName = @"(.*)?Chart.aspx" }); //ignore request for charting request
        routes.Ignore("{*pathInfo}", new { pathInfo = @"^.*(ChartImg.axd)$" });

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

Note that I switch default id and action position. I see mvc can remove the default controller and action name in url when using “Html.ActionLink(…)”. And I don’t like to use explicit url string in my views. How can make it work?

My Action code is simple:

    [ChildActionOnly]
    public ActionResult Navigator()
    {
        return PartialView(appFacility.GetAll());
    }

Thanks alot.

  • 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-21T15:10:36+00:00Added an answer on May 21, 2026 at 3:10 pm

    Wrong route URL definition and defaults combination

    The problem is that you can’t have non optional parameters after an optional parameter.

    Why does localhost/application/index work? This are route values:

    • controller = "application" (supplied from URL)
    • id = "index" (supplied from URL)
    • action = "Index" (supplied as route default)

    Basically these values equal to localhost/application/index/index request URL.

    If you’d like your RenderAction to work, you’d have to call it this way:

    <% Html.RenderAction("Navigator", "Application", new { id = 0 }); %>
    

    which would equal to localhost/application/0/navigator request URL.

    But you’ll soon find out that your route doesn’t work and you’ll have to change it (because I suppose you don’t like having that additional 0 in your URL). If you provide information how you’d like your route work (or why you’ve decided to switch action and id) we can provide an answer that will help you meet your requirements.

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

Sidebar

Related Questions

I have a web project using asp.net mvc3. Now clients ask for a security
I have an asp.net mvc3 project, it has some reports in aspx web pages.
I'm working on a web application project using ASP.NET MVC3 and database in SQL
I am using ASP.NET MVC3. Adding a web project, it gives me all the
I have created a sample project using ASP.NET MVC 3 Web Application (Razor) template.
I'm working on a Web project using Asp.Net MVC, which I'll have to deploy
I'm starting a new web project using ASP.NET Webforms + EF4. I'm trying to
I have a Code folder in my asp.net mvc web project, I added a
I am working on a c# project using ASP .net. I have a list
I am trying to create a web app using ASP.Net MVC3, Entity Framework and

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.