Rendering a simple link is easy:
@Html.ActionLink("About this Website", "About")
But how would you write the following in razor syntax:
<a>
<span>Hello, I'm inconvenient!</span>
</a>
Appreciate any point in the right direction :)
Rendering a simple link is easy:
@Html.ActionLink("About this Website", "About")
But how would you write the following in razor syntax:
<a>
<span>Hello, I'm inconvenient!</span>
</a>
Appreciate any point in the right direction :)
You can create a custom Html Helper, and can reuse it in any View in application:
and use it in View:
Output HTML:
I'm not sure I follow your example properly as it doesn't contain a link and the text for the link is different to that of the span but something like this should give you a general idea:
Using
Url.Action()
will return the actual hyperlink rather than the element.