1

我在尝试:

<%= Html.ActionLink("Link Label", "Index", "controller_name", new { area = "AreaName" }, new { @id = "documentation" })%>

要创建适当的 html 以将用户发送到网页的“文档”部分,方法是将 id 呈现到标题(即)中,然后将“#documentation”放到 url 的末尾,如下所示:

http://localhost/AreaName/controller_name/#documentation

当我手动输入 url 时,mvc 路由将浏览器发送到该部分,我需要的只是一种使 Actionlink 正确呈现 html 的方法。

有任何想法吗?

4

1 回答 1

1

这是您的解决方案,已经解决:

在 ASP.NET MVC Html.ActionLink 中包含锚标记

于 2010-07-20T17:49:09.117 回答