alternative asp.net MVC view engines
Asked Answered
W

4

6

I was wondering if there was a general consensus on the "best" alternative view engine for asp.net MVC. So far I know of Spark, Brail, NHaml but what about others?

Waldheim answered 16/3, 2009 at 9:37 Comment(4)
duplicate: #524144, #173707Pangolin
is a template engine the same as a view engine? if so i did not know thatWaldheim
not exactly the same, but I'd say that view engines build upon template engines, so wherever there's a view engine there's a template engine underneathPangolin
#1451819Pangolin
V
3

I would suggest that you take each of the above View Engines, write a view, and see which works best for you. You might find that for different applications or even for differnt types of view that the choice of View Engine changes.

If you're returning HTML to your client then an engine like Spark might be appropriate. However, if the conent you're returning is XML or some other markup (JSON for example) then Spark won't be much help. NHaml is also focused on XHTML generation.

Consider how you want to test your views, the skill set of your engineers (both developers and testers), the level of support you're hoping to get from your View Engine writer (if you find bugs, how you want those bug fixes deployed) and whether your customer has any preference.

Basically - try a few, see what you like, use a mixture of them if you find that makes sense.

Oh, and here's a good post that lists 4 alternative engines...

http://codebetter.com/blogs/jeffrey.palermo/archive/2008/01/27/mvccontrib-now-offers-four-4-alternative-view-engines-for-asp-net-mvc.aspx

... it mentions an XSLT engine that might be appropriate if you're looking to generate XML.

Videlicet answered 7/4, 2009 at 8:19 Comment(0)
B
2

In software, there are no "best" alternative. It always depends in your background, the company you work for, your preferences, your tastes, etc.

Just pick what work best for you for the current project. If you are not sure, pick the safe way, the MS way :)

Brentbrenton answered 25/3, 2009 at 11:10 Comment(1)
i hear what you're saying Eduardo and yes, the MS way seems like the safe way to go but i read about so many complaints about the MS way (namely regarding tag soup). When I look at Spark for example the markup looks much more elegant. I guess I'll just try Spark :)Waldheim
R
2

StringTemplate is a decent alternative.

Here's the ViewEngine (with Source), and some tutorials.

Ruching answered 16/5, 2009 at 4:28 Comment(0)
F
0

When making you're decision also make sure you consider the skill level and experience within the team.

If you have developers new to mvc then they are going to find a lot more book, examples and solutions if they are using the default engine. Doesn't mean its the "best" or most productive but might provide the quickest ramp-up time for new developers.

Furnivall answered 31/8, 2010 at 4:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.