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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:19:33+00:00 2026-05-25T14:19:33+00:00

I defined a link in my view: @Html.ActionLink(Baxter, Label, new { LabelName = Baxter

  • 0

I defined a link in my view:

@Html.ActionLink("Baxter", "Label", new { LabelName = "Baxter" })

I defined a route to catch this link like this:

        routes.MapRoute(
        "Search Affaire Only Label", // Route name
        "{controller}/Label/{LabelName}", // URL with parameters
        new { controller = "Affaire", action = "SearchAffaires", LabelName = UrlParameter.Optional } // Parameter defaults
        );

The link works but the url is not correctly segmented in the address bar as you can see below:

http://localhost:3817/Affaire/Label?LabelName=Baxter

I thought the url would be formatted like this:

http://localhost:3817/Affaire/Label/Baxter

What’s wrong? Any idea?

Thanks.

  • 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-25T14:19:34+00:00Added an answer on May 25, 2026 at 2:19 pm

    In your anchor you are passing Label as action name (the second argument of the ActionLink helper) whereas in your route definition you have defined the SearchAffaires action. So either fix your anchor by also including the controller:

    @Html.ActionLink("Baxter", "SearchAffaires", new { LabelName = "Baxter" })
    

    or more explicitly give the controller name as well to avoid any ambiguity:

    @Html.ActionLink("Baxter", "SearchAffaires", "Affaire", new { LabelName = "Baxter" }, null)
    

    or modify your route definition to use the Label action on the Affaire controller.

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

Sidebar

Related Questions

I have a route defined with several hardcoded (non-parameter) segments: routes.MapRoute(null, suggestion/list/by/{tag}, new {
I have the following route defined routes.MapRoute( ItemName, {controller}/{action}/{projectName}/{name}, new { controller = Home,
I configured my web application like this link http://static.springsource.org/spring/docs/3.0.0.M3/spring-framework-reference/html/ch17s04.html My context <bean id=freemarkerConfig class=org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer>
I have a nested form in a rails view that is called like this
I have an activity defined thus: [Activity (Label = MyActivity)] [IntentFilter (new[]{Intent.ActionView}, Categories=new[]{Intent.CategoryDefault, Intent.CategoryBrowsable},
When we define routes in routes.rb using the name like map.some_link .We can use
I defined a global variable that is called from other view and it is
I defined a Window in WPF, into this one I put a stack panel
I have defined file path like- $docRoot = $_SERVER['DOCUMENT_ROOT']; $webRoot = str_replace(array($docRoot, 'library/config.php'), '',
I am writing a small Sinatra-based app and would like each view to be

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.