开发者

ASP.NET MVC ActionLink to Produce the Following HTML

开发者 https://www.devze.com 2023-01-14 11:51 出处:网络
How can I produce following code in ASP.NET MVC with ActionLink (not format throw css) <a href=\"#\"><anotherHtmlElement>Title</anotherHtmlElement></a>

How can I produce following code in ASP.NET MVC with ActionLink (not format throw css)

<a href="#"><anotherHtmlElement>Title</anotherHtmlElement></a>
example
<a href="#"><strong>Title</strong>&开发者_C百科lt;/a>


Why do it that way? How about

 <anotherHtmlElement><a href="#">Title</a></anotherHtmlElement>

Also, rather than using <strong>, you should be handling your formatting in CSS.


You can't unless You introduce new htmlHelper extension method.


Why not use "Url.Content"? Like:

 <p>
   Xopto Text <a href="@Url.Content("~/Controller/Action")">in the Controller/Action directory</a>.
 </p>
0

精彩评论

暂无评论...
验证码 换一张
取 消