开发者

with mvc.net partial view, how do i access the model assigned to the template

I have another simple question for all you mvc gurus.

I have a partial view with the following definition.

<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IList<whoozit.Models.Pictu开发者_如何学PythonreModel>>" %>

How do I access the data that has been assigned to the view?


You could do something like:

<% foreach (whoozit.Models.PictureModel picture in Model)
   { %>
    <%: picture.property1 %><br />
    <%: picture.property2 %><br />
    etc...
<% } %>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜