Difference Between Razor View Engine and ASPX View Engine

S.No
Razor View Engine
ASPX View Engine
1
What is Razor View Engine ?

Razor Engine is an advanced view engine that was introduced with MVC3.
This is not a new language but it is a new markup syntax that allows
you to combine code and content in a fluid and expressive manner.

What is ASPX View Engine ?


ASPX View Engine (Web Form Engine ) is the default view engine for the Asp.net MVC
that is included with Asp.net MVC from the beginning.

2

File Extensions used with Razor View Engine?


The file extensions used with Razor Engine are different from Web Form
Engine. It has .cshtml (Razor with C#) or .vbhtml (Razor with VB)
extension for views, partial views, editor templates and for
layout pages.


File Extensions used with ASPX View Engine?


The file extensions used with Web Form Engine are also like Asp.net Web
Forms. It has .aspx extension for views, .ascx extension for
partial views & editor templates and .master extension for
layout/master pages.

3

Syntax used for Razor View Engine ?

Razor has new and advance syntax that are compact, expressive and
reduces typing.

Syntax used for ASPX View Engine ?

Web Form Engine has the same syntax like Asp.net Web Forms uses for
.aspx pages .

4

Whether Razor View Engine’s Syntax is simple or complex?


Razor syntax are easy to learn and much clean than Web Form syntax.
Razor uses @ symbol to make the code like as:

@Html.ActionLink(“Login”, “Login”)


Whether ASPX View Engine’s Syntax is simple or complex?
Web
Form syntax are borrowed from Asp.net Web Forms syntax that are
mixed with html and sometimes make a view messy. Webform uses <%
and %> delimiters to make the code like as:

<%:Html.ActionLink(“SignUp”, “SignUp”) %>

Advertisements