Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

alternative asp.net MVC view engines

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?

like image 784
codette Avatar asked Mar 16 '09 09:03

codette


People also ask

What are the different view engines available for ASP.NET MVC?

With last week's introduction of Razor, there are now four major view engine for ASP.NET MVC. The others are Spark, NHaml, and the traditional ASPX file templates. This article introduces the four engines with a special focus on the new Razor engine.

Is ASP.NET MVC outdated?

Is the framework outdated? ASP.NET MVC is no longer in active development. The last version update was in November 2018. Despite this, a lot of projects are using ASP.NET MVC for web solution development.

Is Razor better than MVC?

From the docs, "Razor Pages can make coding page-focused scenarios easier and more productive than using controllers and views." If your ASP.NET MVC app makes heavy use of views, you may want to consider migrating from actions and views to Razor Pages.


1 Answers

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.

like image 50
Martin Peck Avatar answered Sep 28 '22 08:09

Martin Peck