1 December 2013

Difference Between Razor View Engine and ASPX View Engine in MVC

Difference Between Razor View Engine and ASPX View Engine in MVC

ASPX View Engine is the default view engine for the Asp.net MVC that is included with Asp.net MVC from the beginning.
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.

ASPX View Engine doesn't support TDD (Test Driven Development)
Razor Engine supports TDD (Test Driven Development)

ASPX View Engine support design mode in visual studio means you can see your page look and feel without running the application.
Razor Engine, doesn't support design mode in visual studio means you cann't see your design page look and feel.

ASPX View Engine is faster than Razor Engine.
Razor Engine is little bit slow as compared to Webform Engine.

Syntax
Webform uses <% and %>
for example
< %: Html.ActionLink("SignUp", "SignUp") % >
Razor uses @ symbol
for example
@Html.ActionLink("SignUp", "SignUp")


ASPX View Engine does not prevent XSS attacks means any script saved in the database will be fired while rendering the page.
Razor Engine prevents XSS attacks(Cross-Site Scripting Attacks) means it encodes the script or html tags like <,> before rendering to view.



No comments:

Post a Comment

Comments Welcome

Consistency level in Azure cosmos db

 Consistency level in Azure cosmos db Azure Cosmos DB offers five well-defined consistency levels to provide developers with the flexibility...