I’m currently in the planning stages for a web application that I’m planning on building on top of the ASP.NET MVC extensions, and am trying to figure out which view engine would be best.
The three that I’ve looked at so far have been the standard ASP.NET WebForms, NVelocity and NHaml. I kinda like what I see in NVelocity and NHaml, but the documentation and support appears to be a little bit lacking. I had a hard time trying to figure out how to get started and up-and-running with either of them (though I’m sure I could figure it out if I spent more than an hour or so with either one). So for the most part, I’ve been kinda leaning towards just using WebForms.
Can I really trust WebForms with my HTML though? I really don’t like what it does behind-the-scenes with the markup that’s returned to the client from the server. Just today, I wrote some code to programmatically disable a radio button on a page under certain conditions. The result was that the formatting of my form was *completely* jacked up. Why? (these aren’t the only reasons…we have some pretty serious stylesheet issues involved here as well, but that’s another story that I won’t get into right now) Because the WebForms engine decided that not only should the disabled property of the input tag for the radio button be set to "disabled" (as it should…as I expected), but it ALSO decided to wrap the radio button input tag with <span disabled="disabled"></span>.
!?!?!!
What is THAT? I mean, its bad enough that it unnecessarily wrapped the input tag with a span tag, but it also applied a non-standards-compliant attribute to the tag too ("disabled" is NOT a valid attribute for a span tag). I’m pretty picky about my code…and I try to keep it as close to standards-compliant as possible. I’m just not sure I trust WebForms to be able to generate markup that I’d be OK with.
I mean, I know I *could* use WebForms and just write my own markup and use server tags to inject data where I want it, but what’s the point? If I’m going to do that, why not just use an alternate view engine that will handle all of that for me *and* generate valid markup?
Anybody have any thoughts on this? Experience with any alternate view engines for an ASP.NET MVC app? Is getting off the ground with NVelocity or NHaml easier than I thought? Are there others? Any and all feedback on this would be greatly appreciated.

Hi Bob,
I think part of the answer lies in who will be working with the markup. For Graffiti (http://graffiticms.com) we went with NVelocity because we felt it would be easier to teach non-developers how to make custom themes (or simply update an existing theme).
If you (or other developers on your team) will be the only making UI changes and enhancements, I would probably stick with server controls. You have better support, likely better performance, and more flexibility long term.
If the answer is somewhere in between (a UI team) the choice is probably harder. Learning NVelocity is certainly much easier (if only because it is a limited feature set).
HTH,
Scott
Scott - Thanks for the feedback, thats very helpful. Considering that…as I’ve thought about it more today and done some more reading, I am now leaning more towards just using WebForms. For the application I’m referring to, it will most likely be just me, and maybe if I’m lucky one or two other people working on the UI, so we can handle just using WebForms. Based on my comments above about the output after disabling the radio button though, I think I will most likely *not* use server controls though. I will probably end up just writing the HTML by hand (or, XHTML if you would prefer) and just use server tags to inject data and perform logic. I’ve had some success with that route in the past. In the end, it may take a little bit longer, but I’ll end up knowing exactly what I’m getting.
Thanks again for the feedback. If you have any other thoughts, feedback is always appreciated.
[...] posted last week asking for thoughts on whether or not to use WebForms or one of the alternatives out there as a [...]