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

拜拜、爱过 提交于 2019-12-02 21:32:22
Darin Dimitrov

Like this:

<p>
    @Html.Action(MVC.MeetingActions.ListActions(Model.MeetingId))
</p>

or if you insist on RenderAction like this:

<p>
    @{Html.RenderAction(MVC.MeetingActions.ListActions(Model.MeetingId));}
</p>

Personally I prefer the first, makes fewer keystrokes.

Html.Partial should work as well :)

@Html.Partial("View", Model);

I had the same issue. What worked for me is to encapsulate the expression it in curly brackets.

@{Html.RenderPartial("viewName", Model);}

Ahmed

Difference between Html.RenderAction and Html.Action

Different things for different purposes. Check out the above link.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!