views:

110

answers:

3

Hi,

I'm thinking of experimenting with alternative View Engines for ASP.NET MVC, and would like to know what other people are using.

Please let me know 1) Which View Engine you use, and 2) Why.

The standard 'web-forms' view engine is of course a valid answer, but please say so only if you have decided to use it for a reason, not just 'Becuase I can't be bothered to change it' ;)

Thank you!

+2  A: 

Most of the time, I use a 'standard' view engine - however, since MVC is so extensible, what happens is that sometimes we only need to inherit from it, override some little bit of functionality, and then plug it back in.

In addition, having looking at the Spark view engine, their particular style of making view code didn't gel well with me, but that's no fault of theirs - just different strokes for different folks.

Tejs
+1  A: 

The standard view engine has the most functionality in terms of both Visual Studio compatibility and ASP.NET MVC compatibility, but it's the least readable.

Spark view engine is usually preferred by most people, mainly because it has a nicer view, and it's mostly "compatible" with the designer crews, who only know how to create HTML pages. It also has some C# IntelliSense support for Visual Studio 2008. If you need to give out the view to designers Spark is the best choice.

Coming from the rails/merb world I actually prefer NHaml, because it's very expressive, and DRY, although it's not really "designer friendly". It also has some C# IntelliSense support too. (N)Haml is a view engine that people either hate or love because it's terse nature.

As far as i know these are the only three view engines that have support for C# Intellisense (and only for VS 2008, although work to get them run under VS 2010 is in progress), which can help a lot, and which usually people who want to switch from the "standard" view engine consider a "must-have".

Don't forget however that you can mix view engines in a project, so you can use the standard view engine where you need it's functionality but switch to spark/nhaml/anything else if they suit your needs better.

SztupY
+2  A: 

You could take a look as SharpDOM view engine - http://sharpdom.codeplex.com/ - it combines the clearness of HTML and C# logic in rather consistent manner.

vtimashkov