Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a Mvc2 Project with Razor View Engine

I've read how to use Spark View Engine instead of Webform View Engine in a Mvc2 Project so I think we can do the same with Razor View Engine but when I search on GOOGLE, I cant find anything helpful. So, to you pros I post this question. Please help! Thanks so much!

Attention: Razor in Mvc2 project, not in Mvc3. Thanks again!

like image 983
Luke Avatar asked Mar 11 '11 14:03

Luke


People also ask

What is the use of Razor View Engine in MVC?

View Engine is responsible for rendering the view into html form to the browser.

Is Cshtml a Razor?

All Razor files end with . cshtml. Most Razor files are intended to be browsable and contain a mixture of client-side and server-side code, which, when processed, results in HTML being sent to the browser. These pages are usually referred to as "content pages".

What is the difference between MVC and Razor pages?

A Razor Page is almost the same as ASP.NET MVC's view component. It has basically the syntax and functionality same as MVC. The basic difference between Razor pages and MVC is that the model and controller code is also added within the Razor Page itself. You do not need to add code separately.


1 Answers

While this is technically possible, you'll need to copy vast swaths of code from the MVC3 source.

Razor will still need .Net 4.0, so this is really not worth it; you should just upgrade to MVC3.

like image 128
SLaks Avatar answered Sep 25 '22 07:09

SLaks