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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:43:07+00:00 2026-05-30T15:43:07+00:00

I have created a binding to create a tag for Html.ActionLink html helper like

  • 0

I have created a binding to create a tag for Html.ActionLink html helper like this that works fine:

<element name="actionlink">
    Html.ActionLink("child::*", "@action", new RouteValueDictionary{{"@route-*"}})
</element>

Using the tage like <actionlink action="index" route-controller="users" route-id="${Model.Id}"/> creates the anchor tag correctly with the correct href attribute as I would expect.

However, I have then tried overloading the binding on this tag so I can add html attributes such as id, class etc, like this:

<element name="actionlink">
    Html.ActionLink("child::*", "@action", new RouteValueDictionary{{"@route-*"}}, new Dictionary[[string,object]]{{"@*"}})
</element>

You will notice it has the wild card being passed to the last Dictionary parameter, which is the html attributes parameter of the HtmlHelper. However, when I use the actionlink tag in the following way:

<actionlink action="index" route-controller="users" route-id="${Model.Id}" id="linkId" class="className"/>

It creates the same markup as the usage above, i.e. it doesn’t include the id and class html attributes. Am I doing something fundamentally wrong here? Can anybody see what is incorrect?

  • 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-30T15:43:09+00:00Added an answer on May 30, 2026 at 3:43 pm

    When using bindings the thing you have to be aware of is that bindings are matched in the order they are declared so if you have the bindings declared in the order that you have specified above, the second binding would never get matched.

    If you switch the bindings to the order below, then it should work:

    <!-- most specific binding first -->
    <element name="actionlink">
        Html.ActionLink("child::*", "@action", new RouteValueDictionary{{"@route-*"}}, new Dictionary[[string,object]]{{"@*"}})
    </element>
    <element name="actionlink">
        Html.ActionLink("child::*", "@action", new RouteValueDictionary{{"@route-*"}})
    </element>
    

    Also, when using bindings you need to be aware that changes don’t get picked up until you rebuild your solution, so if you’re making changes, they could be right, but it might just not look like they’re getting picked up because you haven’t rebuilt yet.

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

Sidebar

Related Questions

I have created an XML schema (foo.xsd) and used xjc to create my binding
I have created a listbox control with following DataTemplate <DataTemplate x:Key=lb_Itemtemplate> <DockPanel> <TextBlock Text={Binding}
I have created a PHP-script to update a web server that is live inside
I have created a UserControl that has a ListView in it. The ListView is
I have created a few small flash widgets that stream .mp3 audio from an
i have created a workflow activity that do give the item creater of a
I have created a WCF service that needs to be hosted in a Window
I am loading some XAML pages that I have created that have some data
I have a class like this: private class MyClass { [DisplayName(Foo/Bar)] public string FooBar
I am trying to create a menu bar for my application. I have created

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.