我正在追踪Phil Haack's tutorial以建立一个Html.Action
:
[ChildActionOnly]
public async Task<ActionResult> DisplayProductMapTable(long onlineStoreId)
{
var productMapViewModels = await _shopifyProductService.LoadProductMapViewModels(onlineStoreId);
return PartialView("_ProductMapTable", productMapViewModels);
}
我不知道为什么在尝试返回PartialView
时出现编译错误:
名称“ PartialView”在当前上下文中不存在
并且Visual Studio IntelliSense给我的建议是:
用'PartialViewResult'替换'ParialView'
为什么会出现此错误?我看过太多教程返回PartialView
本教程指向:
[ChildActionOnly]
public ActionResult DisplayProductMapTable(long onlineStoreId)
{
var productMapViewModels = _shopifyProductService.LoadProductMapViewModels(onlineStoreId);
return PartialView("_ProductMapTable", productMapViewModels);
}