Render link containing span in ASP.net MVC Razor?

后端 未结 2 470
无人共我
无人共我 2021-01-26 12:08

Rendering a simple link is easy:

@Html.ActionLink(\"About this Website\", \"About\")

But how would you write the following in razor syntax:

2条回答
  •  失恋的感觉
    2021-01-26 12:23

    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:

    
        Hello, I'm inconvenient!
    
    

    Using Url.Action() will return the actual hyperlink rather than the element.

提交回复
热议问题