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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:39:42+00:00 2026-05-14T21:39:42+00:00

At the moment I have just this route defined routes.MapRoute( Default, {controller}/{action}/{id}, new {

  • 0

At the moment I have just this route defined

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

I want to map the /Home/Action1/id to just /Action1/id
anybody knows how ?

  • 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-14T21:39:42+00:00Added an answer on May 14, 2026 at 9:39 pm

    You may have to be careful with a route like you’re asking for because it may catch more than is intended.

    One workaround is to restrict that route by using constraints if possible.

    E.g. Check that id is numeric…

    routes.MapRoute("ActionRoute", 
             "{action}/{id}",
             new { controller = "Home", action = "Index", id="1" },
             new { id = @"\d{1,6}" }
    );
    

    That way you can still specify your generic default route at the end to catch the rest of the routes on the site if needed.

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

Sidebar

Related Questions

I have this routing setup at the moment routes.MapRoute( OldPages, // Route name page{id}.html,
I have a bizarre problem at the moment, I am just making a start
I just started using django for development. At the moment, I have the following
At the moment I have: ^[a-zA-Z0-9_\x7f-\xff]*/[a-zA-Z0-9_\x7f-\xff]*$ I want blah/blah to match, but I don't
At the moment I have this code: @using (Html.BeginForm(Add, Review, Review)) { @Html.ValidationSummary(true) <fieldset>
At the moment I have a jQuery do a POST to a Controller which
In order to show you what I want to do you just have to
Have just come across a problem where I believe this is the solution. At
At the moment I have just targeted my UI graphics for the hdpi resolutions
I have just done an html that should have some areas disabled. This areas

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.