Header Ads

ASPX View Engine vs Razor View Engine

ASPX View Engine  vs Razor View Engine
Difference between aspx view engine and razor view engine
Web Form(ASPX)RAZOR
Namespace: System.Web.Mvc.WebFormViewEngineNamespace:System.Web.Razor
Extension:.aspx extension for views.ascx extension for partial views & editor templates and .master extension for layout/master pagesExtension:.cshtml with C# or.vbhtml with VB extension for views, partial views, editor templates and for layout pages.
ASPX Uses <% and %> delimiter in coding.e.g. <%: Html.ActionLink(“link”, “Click”) %>RAZOR is much easier and cleaner than Web Form. It uses @ symbol in [email protected](“link”, “click”)
ASPX View Engine is the default view engine for the ASP.NET MVC that is included with ASP.NET MVC from the beginning.Razor View Engine is an advanced view engine and introduced with MVC3. This is not a language but it is a mark-up syntax.
Web Form 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 cannot see your page look and feel without running application.
Web Form Engine doesn’t support TDD (Test Driven Development) since it depend on System.Web.UI.Page class which makes the testing complexRazor Engine support TDD (Test Driven Development) since it is not depend on System.Web.UI.Page class.
Web Form is comparatively faster but less secure than RAZOR. Web Form Engine does not prevent XSS attacks means any script saved in the database will be fired while rendering the pageRAZOR engine comparatively slow but provides better security than ASPX. Razor Engine prevents XSS attacks(Cross-Site Scripting Attacks) means it encodes the script or html tags like <,> before rendering to view.

No comments:

Powered by Blogger.