次の文字列を指定します。
/MyController/MyAction/4
適切なアドレスにリンクするために別のコントローラのアクション内でリンクを生成するにはどうすればよいですか?
私が次のことをした場合:
@Html.ActionLink("click", Url.Action(item.Link))
// where item.Link is where /MyController/MyAction/4 is stored
次のようなリンクが表示されます。
www.localhost.com/CurrentController/CurrentController/MyController/MyAction/4
「CurrentController」の部分は必要ありません (はい、2 つあります。@Html.ActionLink と Url.Action を実行しているためだと思います)。
適切なリンクを取得するにはどうすればよいですか?