How can I use Html.DisplayFor inside of an iterator?

前端 未结 6 1473
死守一世寂寞
死守一世寂寞 2020-12-03 06:23

I am loving MVC 2. The whole thing just fits the web so well.

There is one piece of functionality, however, that I am unable to coax out of the Html.

6条回答
  •  时光取名叫无心
    2020-12-03 07:00

    Actually, I figured it out. How stupid of me.

    This works:

    <@ Page Inherits="ViewPage>">
    
    <% foreach(var item in Model) { %>
    
        <%: Html.DisplayFor(m => item.BarBaz) %>
    
    <% } %>
    

提交回复
热议问题