Hi i just downloaded MVC 3 and found an new view engine called "RAZOR". How is it useful?
What benefits does it provide?
How is different from ASPX pages?
Where should one use RAZOR view engine?
Hi i just downloaded MVC 3 and found an new view engine called "RAZOR". How is it useful?
What benefits does it provide?
How is different from ASPX pages?
Where should one use RAZOR view engine?
Although a bit out of date qua syntax: ScottGu explains most of it.
Quick Syntax reference can be found on Haacked blog.
Difference Between Razor View Engine and ASPX View Engine in MVC
http://royalarun.blogspot.in/2013/12/difference-between-razor-view-engine.html
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
Razor uses @ symbol for example
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.
Scott Gu covered most of your questions in his Razor introductory blog post: