ASPX View Engine vs Razor view Engine




The main Difference is

1.ASPX View Engine does not prevent XSS attacks(Cross site scripting) 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

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


3. 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.

4.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.

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

Comments