所以我有这个动作链接
@Html.ActionLink("Logout","LogoutConfirmation","Login")这把我带到了一个网址: mysite.com/myaccount/Login/LogoutConfirmation 但是文件夹不在“myaccount”中,这就是我在这个网页上的当前位置。 如何将操作链接带我: mysite.com/Login/LogoutConfirmation 而不是文件夹“myaccount”。
So I have this action link
@Html.ActionLink("Logout","LogoutConfirmation","Login")which takes me to a url like: mysite.com/myaccount/Login/LogoutConfirmation however the folder isnt located in "myaccount" its just that is my current location on this webpage. How can I make the action link to take me to: mysite.com/Login/LogoutConfirmation instead of the folder "myaccount".
最满意答案
正如我的评论中所述,只需使用重载方法来包含空Area 。
@Html.ActionLink("Logout","logoutConfirmation", "Login", new {Area=""},null)
As stated in my comment, just use the overloaded method to include an empty Area.
@Html.ActionLink("Logout","logoutConfirmation", "Login", new {Area=""},null)
更多推荐
发布评论