cannot implicitly convert type void to object. .NET MVC PartialViewResult

后端 未结 4 1152
逝去的感伤
逝去的感伤 2021-02-02 04:59

I have the following controller action:

[ChildActionOnly]
public virtual PartialViewResult ListActions(int id)
{
    var actions = meetingActionRepository.GetAll         


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-02 05:29

    Like this:

    @Html.Action(MVC.MeetingActions.ListActions(Model.MeetingId))

    or if you insist on RenderAction like this:

    @{Html.RenderAction(MVC.MeetingActions.ListActions(Model.MeetingId));}

    Personally I prefer the first, makes fewer keystrokes.

提交回复
热议问题