1

MVC 6に基づく非常に単純なソリューションがあります。

ViewComponent -> /ViewComponents/PriorityListViewComponent.cs

public class PriorityListViewComponent : ViewComponent
{
    public IViewComponentResult Invoke(int maxPriority)
    {
        return View();
    }
} 

「部分」ビュー /Views/Components/PriorityList/Default.cshtml

Empty view 

/Views/Shared/Index.cshtml を表示

@{
    Layout = "~/Views/Shared/BaseView.cshtml";
 }
 @Component.Invoke("PriorityList", 1)

上記は HTTP 500 エラーを返しますが、その理由がわかりません。パスに関するすべてのルールが守られていると思います。

4

1 に答える 1