gpt4 book ai didi

asp.net-mvc - 从mvc4的主页调用区域的 Action

转载 作者:行者123 更新时间:2023-12-02 01:51:04 24 4
gpt4 key购买 nike

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

我想调用“ABC”区域 Controller 的 Action

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

从主站点页面我想调用 Accountcontroller 的 Action Index,这是我的区域 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

我找不到解决这个问题的方法。

最佳答案

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

关于asp.net-mvc - 从mvc4的主页调用区域的 Action ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22646490/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com