How do I bypass the HTML encoding when using Html.ActionLink in Mvc?

前端 未结 5 1402
醉酒成梦
醉酒成梦 2020-12-08 02:27

Whenever I use Html.ActionLink it always Html encodes my display string. For instance I want my link to look like this:



        
5条回答
  •  無奈伤痛
    2020-12-08 02:48

    The answer given by Sam is actually correct and I used it in my solution so I have therefore tried it myself. You may want to remove the extra parenthesis so it becomes something like this:

    @Html.ActionLink(HttpUtility.HtmlDecode("&"), "Index", "Home")
    

提交回复
热议问题