0

My first ActionLink is ok. But how can I add h3 tags ?

<a href="/channel/index/44">@a.Title</a>
@Html.ActionLink(@a.Title, "Index", "Channel", new { @a.Id }, null)

How can i do actionlink this link?

<a href="/Channel/index/44"><h3>@a.Title</h3></a>
 ?
user3583183
  • 91
  • 1
  • 5

2 Answers2

1

The only way you can get HTML markup in your link text is to use @Url.Action. For example your code will look like this:

<a href="@Url.Action("Index", "Channel", new { Id = a.Id })"><h3>@a.Title</h3></a>
DavidG
  • 113,891
  • 12
  • 217
  • 223
0

use url.action to get the url

<a href="@Url.Action("Index", "Channel", new { id = 44 })"><h3>@a.Title</h3></a>
Matt Bodily
  • 6,403
  • 4
  • 29
  • 48