Great discussion guys.
I have a 4 comments. please read through before flaming *wink and a smile*
1) People tend to complain about "logic in the view" and talk about "logic vs markup". They say that "logic doesn't belong in the view", but whether you're using controls or code blocks, you're still using logic. The point is, this logic is "view logic" which absolutely belongs inside the view (whether it's hidden inside controls or visible in code blocks)
DavidKiff:[GridView exmaple]
Less lines of code!! No foreach logic within the markup! The only
advantage I can see that the MVC view has is type-safty! If you really
want complete control over you code why not use a repeater? That is
the reason they are designed!!
You forgot the lines of code which bind the GridView to a data source. Whether you're defining your data source declaratively, or in code behind, (apart from more lines of code) you're separating it from the grid which makes it a little less discoverable. You're right in saying that the foreach isn't in the markup, but the "logic" is still there, you've just hidden it inside your GridView. This just means you need to understand what your controls are doing behind the scenes, where as "foreach" and "if" can almost be read in english.
2) You mentioned type-safety. Absolutely! But more than that.
a) With data binding you're performing reflection on the data source, so our "type safety" has a significant performance gain.
b) The code is visible to refactoring tools (like Resharper, but not VS?! lol) so when you refactor your data types, Resharper can update the references in your view, but it won't touch things like Eval("el.Value").
c) Intellisense
3) Don't get me wrong, I'm not saying you should use code blocks everywhere. If you do, you're bound create a maintenance nightmare (I've been there). We need a little help. And for this, we have helper methods. HtmlHelper is full of neat little nuggets of html which we can just drop into our pages. We can even avoid using reflection on our data sources by passing delegates to our helper methods (I'm pretty sure this will be implemented in a future release of the framework but you can write it yourself for now). You can't exactly pass delegates to a control!
You're still using <%%> tho, but Html.TextBox() feels more like a control.
4) You asked "why not use a repeater?", you can. And, assuming the MVC team haven't changed their minds, you'll be able to use <mvc: controls just like the <asp: ones you're used to. They'll output nice html but obviously won't respond to postback events etc. They will apparently be wrappers around the HtmlHelper methods (from what I heard).
Plus you can still use your own controls and put some logic in the code behind, as long as you're careful not to expect the WebForms postback model. But a lot of people here frown on using code behind, especially since we don't have to any more.
But as Scott Hanselman said "We've already got a Repeater, it's called "foreach"."