我在尝试:
<%= 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 的方法。
有任何想法吗?