This is just a simple little tip, but it may come in handy if you frequently iterate over collections in your ASP.NET MVC views. How often do your ASP.NET MVC views need to iterate over a collection to render some HTML for each item? For example, if your model is a collection of Person objects, and you want to render a table of them, you might write view code as follows:
A few bits of this code make me uncomfortable:In order to render “even” and “odd” and “last” CSS classes, I used a series of ...


No comments yet, be the first one to post comment.