0

I have an Anchor button with info of the link and a model that generates a count. I need the link to be one color and the Model.Example to be a different color. Is this possible?

Please see code example.

Link in .cshtml

@Html.ActionLink("Example LinkText - (" + Model.Example + ")", "Example actionName", "Example controllerName", new { Model.ExampleID }, new { @class = "btn btn-add" })

Controller

public string Example => Count > 0 ? Count.ToString() : "";

Thanks in advance.

Christoff
  • 21
  • 7

1 Answers1

0

You can create your own link with a different color inside the link:

<a href='@Url.Action("Example actionName")'>Example LinkText - (<span class='some-class'>@Model.Example</span>)</a>
Martin Staufcik
  • 8,295
  • 4
  • 44
  • 63