Rendering partial views with Razor in MVC5

前端 未结 3 1089
误落风尘
误落风尘 2021-02-12 09:52

I\'m trying to get a partial view to render using Razor in MVC5. When I use

@{ Html.RenderPartial(\"ViewName\", model); }

I get the parser erro

3条回答
  •  佛祖请我去吃肉
    2021-02-12 10:48

    You may also use @Html.Partial("~/View/Home/myview.cshtml")

    It returns string while Html.RenderPartial calls Write internally, and returns void.

提交回复
热议问题