【问题标题】:Calling Action of Area from main page in mvc4从 mvc4 的主页调用区域的操作
【发布时间】:2014-03-25 21:20:10
【问题描述】:

我有一个项目,我的主站点中有索引页面。

我想调用位于“ABC”区域的控制器的动作

我在我的主站点和我的区域 ABC 中都有控制器“帐户”。

我想从主站点页面调用 Accountcontroller 的操作索引,这是我的区域 ABC。

我试过的是

@Html.ActionLink("User Profile","Index", new{Area="ABC"})

这指向

http://localhost:50010/ABC/Home

我不想要的

我也试过了

@Html.ActionLink("User Profile","Index","Account", new{Area="ABC"})

这指向

http://localhost:50010?Length=7

我无法找到解决此问题的方法。

【问题讨论】:

标签: asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 razor asp.net-mvc-areas


【解决方案1】:
Html.ActionLink("User Profile", "Index", "Account", new { Area = "ABC" }, new{})

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-05-24
    • 2018-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多