我有应显示一个用户登录到一个帐户名一个强类型的局部视图:
@model MyNamespace.Models.AccountNameViewModel
@if (Request.IsAuthenticated)
{
@Html.Action("AccountName", "AccountNameController", Model)
Logged in to @Model.AccountName
}
我有一个控制器:
public class AccountNameController : Controller
{
public ActionResult Index()
{
return View();
}
[ChildActionOnly]
public ActionResult AccountName(AccountNameViewModel model)
{
... Do somthing with the repository to populate the model
return PartialView(model);
}
}
我想要做的就是添加,显示,用户登录到一个帐户的名称共享的局部视图。 我得到的是以下错误:
The controller for path '/ParentViewPath/' was not found or does not implement IController.
我是不是至少在朝着正确的方向?