我可以指定查找viewModel的位置吗?

时间:2012-01-09 10:38:11

标签: asp.net-mvc asp.net-mvc-3

我想将部分视图模型放在区域内的文件夹中。有没有办法可以指定_City的位置,还是仅查看默认位置?

    public ActionResult CheckCity(string id)
    {
        var model = xxx
        return PartialView("_City", model);
    }

1 个答案:

答案 0 :(得分:2)

是的,您可以指定相对路径: -

返回PartialView(“〜/ Views / SomeFolder / AnotherFolder / SomeView.cshtml”,模型);

相关问题