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
You're right about it being similar to a for loop. A simple implementation might look like this:
<%foreach(var item in Model.Items) { %>
close
<%: item.MemberDescription %>
<% } %>
You'll notice that there are no longer any controls with runat="server", nor are there any events linked to handlers in the code-behind. Instead, we are assuming that the controller has populated the Model object with objects representing the data that we need to display. That is the role of the controller when using MVC.