我怎么能生产出以下在ASP.NET MVC ActionLink的带(未格式抛CSS)ASP.NET MVC ActionLink的生成以下HTML
<a href="#"><anotherHtmlElement>Title</anotherHtmlElement></a>
example
<a href="#"><strong>Title</strong></a>
我怎么能生产出以下在ASP.NET MVC ActionLink的带(未格式抛CSS)ASP.NET MVC ActionLink的生成以下HTML
<a href="#"><anotherHtmlElement>Title</anotherHtmlElement></a>
example
<a href="#"><strong>Title</strong></a>
为什么这样呢?如何
<anotherHtmlElement><a href="#">Title</a></anotherHtmlElement>
此外,而不是使用<strong>
,你应该处理您的格式在CSS。
你不能,除非你介绍新的HtmlHelper扩展方法的代码。
为什么不使用“Url.Content”?像:
<p>
Xopto Text <a href="@Url.Content("~/Controller/Action")">in the Controller/Action directory</a>.
</p>
为什么不呢?例如。 - 如果'img'标签应该用作链接,则它必须用'a'标签包围。 – 2010-09-02 18:35:53
MvcHtmlString自动编码字符串。这样更安全;-) – gnome 2010-09-02 18:37:39