Asp.net mvc 来自不同目录的Html.RenderAction

Asp.net mvc 来自不同目录的Html.RenderAction,asp.net-mvc,renderaction,Asp.net Mvc,Renderaction,我是Asp.NETMVC新手。这是我的解决方案层次结构 PROJECT --Area -- Account --Controllers --Models --Views -- Edit.cshtml -- Contollers (this has an action method "SomeAction") --Models -- Views

我是Asp.NETMVC新手。这是我的解决方案层次结构

PROJECT
    --Area 
        -- Account
            --Controllers
            --Models
            --Views
                -- Edit.cshtml
    -- Contollers (this has an action method "SomeAction")
    --Models
    -- Views
         --Shared
           --Partial.cshtml
实际上,我想在Edit.cshtml视图中呈现Parial.cshtml。所以我试过了

@{Html.RenderAction("ControllerName", "SomeAction");}   
但我犯了以下错误

找不到路径“/Account/Edit”的控制器,或者 不实现IController

不知道我错过了什么


如果我从视图中删除@{Html.RenderAction(“ControllerName”,“SomeAction”);}。它工作正常

您应该将区域名称传递给
RenderAction
方法:

@{Html.RenderAction("ControllerName", "SomeAction", new{area=""});}

您应该将区域名称传递给
RenderAction
方法:

@{Html.RenderAction("ControllerName", "SomeAction", new{area=""});}

我的操作方法没有任何参数。那个么为什么我要传递区域作为路由值呢?参数区域并没有传递给动作方法。它设置了控制器应该位于的区域。好的,明白了。但行动并不在这一领域。它位于根“Controller”文件夹中,我正在尝试从区域中的视图(Edit.cshtml)呈现该操作。我的操作方法没有任何参数。那个么为什么我要传递区域作为路由值呢?参数区域并没有传递给动作方法。它设置了控制器应该位于的区域。好的,明白了。但行动并不在这一领域。它位于根“Controller”文件夹中,我正在尝试从区域中的视图(Edit.cshtml)呈现该操作。