このようなURLに追加するにはどうすればよいですか
mysite.com/articles/1/my-first-article
dividが#commentListの要素
mysite.com/articles/1/my-first-article#commentList
<%: Html.ActionLink("text", "action", new {/* ??? HOW TO SET IT HERE ??? */})%>
このようなURLに追加するにはどうすればよいですか
mysite.com/articles/1/my-first-article
dividが#commentListの要素
mysite.com/articles/1/my-first-article#commentList
<%: Html.ActionLink("text", "action", new {/* ??? HOW TO SET IT HERE ??? */})%>
適切なオーバーロード(フラグメントを取得するもの)を使用してみてください。これにより、フラグメント部分を含む目的のURLを生成できます。
<%= Html.ActionLink(
"some text", // linkText
"articles", // actionName
null, // controllerName
null, // protocol
null, // hostName
"commentList", // fragment <-- that's what you need
new { id = 1 }, // routeValues
null // htmlAttributes
) %>