ASP.NET MVC ActionLink の fragment を付ける方法

📋 目次(クリックで展開)

ActionLink に fragment を付ける方法を調べたところ、下記のような実装方法がありました。

cshtml での実装

@Html.ActionLink($"Link Text", "MyAction",
"MyController", null, null, "fragmentString", null, null)

出力結果はこんな感じです。
http://localhost/MyController/MyAction#fragmentString

参考情報

Including an anchor tag in an ASP.NET MVC Html.ActionLink
http://stackoverflow.com/questions/274586/including-an-anchor-tag-in-an-asp-net-mvc-html-actionlink/274637#274637


💬 コメント