mvc 3 equivalent to function?

后端 未结 4 1197
不思量自难忘°
不思量自难忘° 2020-12-08 07:51

I have a website in Asp.Net that I am trying to port to MVC 3 and I have only worked with MVC 2 before. I stumbled across the following asp function

4条回答
  •  盖世英雄少女心
    2020-12-08 08:24

    A repeater is just a loop that provides databinding so that you can access the items in the collection that you are looping. If you look in the ourTeamRepeater_ItemDataBound method you will find the code that uses the databound items to populate the elements in the item template with data.

    Usually you can just use a foreach loop in MVC to loop the items. Example:

    <% foreach (var item in items) { %>
      
    <%= item.Description %>
    <% } %>

提交回复
热议问题