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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:43:19+00:00 2026-05-11T07:43:19+00:00

I have set up an ASP.NET MVC project, and everything is working great, but

  • 0

I have set up an ASP.NET MVC project, and everything is working great, but I do have one problem with the routing. My Global.asax looks like this:

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 = '' }  // Parameter defaults         );     } 

So, nothing out of the ordinary. My problem is that when I link to a controller/action/params with an HTML.ActionLink like so:

<%= Html.ActionLink('My link', 'SomeAction', 'SomeController', new {param='someParam'})%> 

it should generate (at least what makes sense in my head) a link such as: http://www.localhost/SomeController/SomeAction/someParam.

But instead it generates a link like this: http://localhost/SomeController/SomeAction?param=someParam

If i manually make a link that links to the expected result (SomeController/SomeAction/someParam) then the right controller and action are called, but the parameter defined in the action method is always null.

Any ideas?

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T07:43:20+00:00Added an answer on May 11, 2026 at 7:43 am

    I think that link will only use the default route like you expect if the parameter name is id instead of param. You’ll have to create a different route if you want to provide some other parameter there.

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

Sidebar

Related Questions

I have nant set up to build my ASP.NET MVC project and it works
I have a project using Asp.Net 3.5 and MVC 1. Everything runs perfectly on
I'm using ASP.NET MVC RC2. I have a set of classes that were auto-generated
I am working with couple of friends on an ASP.NET MVC website. The project
I have an ASP.NET MVC project that works fine on my local machine (no
I have an ASP.NET MVC 3 project that I just created using the project
On my ASP.NET MVC 3 project, I have implemented the repository pattern inside a
I have a project consisting of three projects, WCF service Asp.net MVC 3 application
Im working on a web project in ASP .NET MVC 2. In this project
Here's my situation: I have been working on an ASP.NET MVC 3 application for

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.