开发者

Passing model information to RenderPartial

开发者 https://www.devze.com 2023-02-19 12:55 出处:网络
Hi I have this line of code: 开发者_运维知识库 <% Html.RenderPartial(\"VenuesList\"); %> What I need to do is pass it my model via the additional parameters available in the overides. What do I

Hi I have this line of code:

开发者_运维知识库

<% Html.RenderPartial("VenuesList"); %>

What I need to do is pass it my model via the additional parameters available in the overides. What do I write? My model is Venue. Thanks.


You could use the following overload allowing you to pass a model to the partial:

<% Html.RenderPartial("VenuesList", Model.SomeProperty); %>

or directly the model if it is of the correct type as expected by the partial:

<% Html.RenderPartial("VenuesList", Model); %>
0

精彩评论

暂无评论...
验证码 换一张
取 消