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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:52:01+00:00 2026-06-09T05:52:01+00:00

ASP.NET MVC 3 Routing confuses me. I feel like I’ve read everything I can,

  • 0

ASP.NET MVC 3 Routing confuses me. I feel like I’ve read everything I can, but sometimes, I still just don’t get it. I am trying to create a URL that I can visit that looks like

/authorized/home/children/{childID}

I want that URL to show an HTML view that loads the contents for a specific child. My view is defined as follows:

/Views/Authorized/Home/Children/Child.cshtml

In my global.asax.cs file, I have added the following route:

  routes.MapRoute(
    "Child", // Route name
    "{controller}/Home/Children/{action}/{id}",
    new { controller = "Authorized", action = "Child", id = UrlParameter.Optional }
  );

In AuthorizedController.cs, I have the following:

public ActionResult Child(string id)
{
  return View("~/Views/Authorized/Home/Children/Child.cshtml");
}

If I visit /authorized/home/children, I see the contents of Child.cshtml. However, if I visit /authorized/home/children/1, I get a 404.

What am I doing wrong? Thank you

  • 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-09T05:52:04+00:00Added an answer on June 9, 2026 at 5:52 am

    The route you shared does not match the route you’re saying you’re wanting.

    You want:

    /authorized/home/children/{childID}
    

    But, you’re route is expecting:

    /Authorized/Home/Children/{action}/{id}
    

    Note the additional action parameter there. Is children your action in your controller, or is it child? If it’s children you should update your route to this:

     routes.MapRoute(
        "Child", // Route name
        "{controller}/Home/{action}/{id}",
        new { controller = "Authorized", action = "Children", id = UrlParameter.Optional }
      );
    

    However, if it’s Child you’ll need to remove the {action} from your route like this:

     routes.MapRoute(
        "Child", // Route name
        "{controller}/Home/Children/{id}",
        new { controller = "Authorized", action = "Child", id = UrlParameter.Optional }
      );
    

    This will make an explicit route, directing to the Child action.

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

Sidebar

Related Questions

In ASP.NET MVC (default routing),I'd like to use a URL like this to return
I am working with ASP.NET MVC 2 and would like to optimize my routing.
I am still very new to routing with asp.net mvc, so perhaps this is
How would I handle something like the below uri using ASP.NET MVC's routing capability:
asp.net mvc routing pattern is {some_parameter/{controller}/{action}/{id}} Is this a valid format if some_parameter can
I'm using restful routing module for asp.net mvc and very happy with it. But
Is there any tools or utilities to help in debugging ASP.NET MVC Routing issues?
Hello my question is an exact replica of ASP.NET MVC Routing , Html.BeginForm ,
I'm running asp.net MVC site on IIS6 - I've edited my routing to look
I've a very basic ASP.NET MVC application that uses the default routing. Now I

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.