by 深夜連絡 ASP.NET MVC な Web アプリ Advent Calendar 2013 10 日目 今回は、HTML ヘルパー:@Html.ActionLink で、違うコントローラーへのリンクを貼る方法についてです。陥りやすいミスについて少し。 違うコントローラーへリンクを貼る 違うコントローラーへのリンクとは、例えば「~/Books/Details」で表示されるページに、「~/Library/Details」といったリンクを貼ることです。 この場合、URL「~/Library/Details」へのリンクを貼るのは簡単です。↓のようにかきます。 (以降、デフォルトのルーティング設定(~/{controller}/{action}/{id})が適用されているものとします。) @Html.ActionLink("Go to ~/Library/Details", "Detail