Razor View Engine VS Web Form(ASPX) View Engine
Razor View Engine
Web Form 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 was introduced with MVC3.
This is not a new language but it is
a new markup syntax.
Web Form Engine is the default
view engine for the Asp.net
MVC that is included with Asp.net
MVC from the beginning.
view engine for the Asp.net
MVC that is included with Asp.net
MVC from the beginning.
The namespace for Razor Engine
is
is
System.Web.Razor
.
The namespace for Webform
Engine is
Engine is
System.Web.Mvc.WebFormViewEngine
.
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.
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.
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.
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.
Razor has new and advance syntax that
are compact, expressive and reduces typing.
are compact, expressive and reduces typing.
Web Form Engine has the same syntax
like Asp.net Web Forms uses for .aspx pages.
like Asp.net Web Forms uses for .aspx pages.
Razor syntax are easy to learn and much
clean than Web Form syntax. Razor uses
@ symbol to make the code like as:
clean than Web Form syntax. Razor uses
@ symbol to make the code like as:
@Html.ActionLink("SignUp", "SignUp")
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:
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") %>
By default, Razor Engine prevents XSS
attacks(Cross-Site Scripting Attacks)
means it encodes the script or html tags
like <,> before rendering to view.
attacks(Cross-Site Scripting Attacks)
means it encodes the script or html tags
like <,> before rendering to view.
Web Form Engine does not prevent XSS attacks
means any script saved in the database will be
fired while rendering the page
means any script saved in the database will be
fired while rendering the page
Razor Engine is little bit slow as compared
to Webform Engine.
to Webform Engine.
Web Form Engine is faster than Razor Engine.
Razor Engine, doesn't support design mode
in visual studio means you cannot see your
page look and feel.
in visual studio means you cannot see your
page look and feel.
Web Form engine support design mode in visual
studio means you can see your page look and
feel without running the application.
studio means you can see your page look and
feel without running the application.
Razor Engine support TDD
(Test Driven Development) since
it is not depend on System.Web.UI.Page class.
(Test Driven Development) since
it is not depend on System.Web.UI.Page class.
Web Form Engine doesn't support TDD (Test Driven Development) since it depend on
the testing complex.
System.Web.UI.Page
class which makes the testing complex.
Comments
Post a Comment