我有一個視圖,它是可訪問的http://localhost:49467/About/
及其被稱爲index.cshtml
。使用C#添加鏈接mvc
我有另一種看法,其中被訪問的http://localhost:49467/Food/
,被稱爲index2.cshtml
我要放置index.cshtml
頁面內的鏈接,這樣我可以訪問index2.cshtml
。我該怎麼做。我的代碼;
@Html.ActionLink("link", "Food/index")
但我最終在網址http://localhost:49467/About/Food/
和頁面未找到。所有我想要做的是導航到http://localhost:49467/Food/
。我怎樣才能糾正這一點?
'@ Html.ActionLink( 「鏈接」, 「食品/索引2」)'? – 2013-02-21 19:50:02
不起作用。去'../關於/食物/ index2'而不是 – 2013-02-21 19:53:51
你爲什麼用'「食物/索引2」'?正確使用方法...'@ Html.ActionLink(「鏈接文本」,「索引」,「食物」)' – 2013-02-21 19:57:20