Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What View Engine are you using with ASP.NET MVC? [closed]

Tags:

asp.net-mvc

I know you can use several different view engines with ASP.NET MVC:

  • ASPX, obviously
  • NVelocity
  • Brail
  • NHaml
  • et al...

The default ASPX view engine seems to make the most sense to me, coming from an ASP.NET WebForms background.

But, I wanted to get an idea of the pros and cons of each and see what most people are using.

Which does StackOverflow use?

like image 562
John Rutherford Avatar asked Sep 03 '08 21:09

John Rutherford


People also ask

What is view engine in ASP.NET MVC?

The View Engine in ASP.NET is used to translate our views to HTML and then render them to the browser. By default, ASP.Net supports ASPX and the Razor View Engine. The view engine templates have a different syntax than the implementation.

What is the name of new view engine for ASP.NET MVC?

The Razor View Engine is more advanced and is now the default view engine of ASP.NET Core MVC. This article compares these two view engines in brief and then discusses how you can work with the Razor View Engine in ASP.NET Core MVC.

Why we use Razor View Engine in MVC?

It is a server side markup language. Razor has no ties to ASP.NET MVC because Razor is a general-purpose templating engine. You can use it anywhere to generate output like HTML. It's just that ASP.NET MVC has implemented a view engine that allows us to use Razor inside of an MVC application to produce HTML.

Which one is an MVC engine?

View Engine is responsible for rendering the view into html form to the browser. By default, Asp.net MVC support Web Form(ASPX) and Razor View Engine. There are many third party view engines (like Spark, Nhaml etc.) that are also available for Asp.net MVC.


2 Answers

I use Spark. It has nice flow between HTML and code. Scott Hanselman also did a post on it with his weekly source code review posts. I am really digging it a lot. One of the major features is pre-compilation of your views.

like image 122
Dale Ragan Avatar answered Sep 16 '22 12:09

Dale Ragan


"Which does StackOverflow use?"

Web Forms.

I asked Jeff Atwood about his decision on his Tag Soup post. He didn't reply - I think he was busy hunting down a missing closing tag ;-)

like image 39
Andrew Peters Avatar answered Sep 20 '22 12:09

Andrew Peters