0

I like to do something like the following in my MVC View:

  @Html.ActionLink("How do <i>This</i>", "Vtd", "Crs", new { Text= Html.Encode("How it works"}, null) 

Notice how I want This to be in italics as a hyperlink

Nate Pet
  • 44,246
  • 124
  • 269
  • 414
  • Possible duplicate of [ASP MVC3 insert html tag inside actionlink](http://stackoverflow.com/questions/9718866/asp-mvc3-insert-html-tag-inside-actionlink) – Roman Marusyk Dec 01 '15 at 15:04
  • Also see [Putting HTML inside Html.ActionLink(), plus No Link Text?](http://stackoverflow.com/questions/1974980/putting-html-inside-html-actionlink-plus-no-link-text) and [Using HTML tags inside linkText of Html.ActionLink](http://stackoverflow.com/questions/4936681/using-html-tags-inside-linktext-of-html-actionlink) – Roman Marusyk Dec 01 '15 at 15:05

1 Answers1

1

As far as Html.ActionLink() just render <a href=".."></a> tag maby that's not the best way to achive your goal.

I belive in your case it's better to use Url.Action() helper like this:

<a href="@Url.Action("Vtd", "Crs", new { Text= Html.Encode("How it works"}, null })">
    How do <i>This</i>
</a>
teo van kot
  • 12,350
  • 10
  • 38
  • 70