mvc 3 equivalent to function?

后端 未结 4 1202
不思量自难忘°
不思量自难忘° 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:41

    You're right about it being similar to a for loop. A simple implementation might look like this:

    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.

提交回复
热议问题