Gives solution for any Error occurs in any Programming Language, .Net Core 3.1, 3.0, C#,Asp.Net,Sqlserver,MVC,Java,Php,Html,Css,Jquery,errors and solutions,Latest News,Technology

Monday, 25 January 2016

Simple Razor and ASPX View Engine Differences in MVC 3 and MVC 4

No comments :
Razor View Engine
ASPX (WebForm View Engine)
Advance view engine introduced in MVC 3. Not a language but it is a markup syntax
Default view engine for the ASP.NET MVC
System.Web.Razor namespace
System.Web.Mvc.WebFormViewEngine namespace
Use Layouts for masterpages
Use masterpages
Razor View Engine uses PartialPage
ASPX View Engine uses WebUserControls
.cshtml (for c#) and .vbhtml (for VB) extensions for views, Layout and Partial views.
It has a similar extensions for Web application as .aspx for views, .master for Master Pages.
Little bit slow PERFORMANCE compared with ASPX Engine
Faster PERFORMANCE compared with Razor Engine
Syntax : ‘@’ to write the code
Ex : @Html.ActionLink(“Login”,”LoginPage”)
Syntax : ‘<%’ for starting ‘%>’ for ending points
Ex : <%: Html.ActionLink(“Login”,”LoginPage”)
Razor View Engine prevents Cross-Site Scripting attacks (XSS attacks) means it encodes the script and HTML tags as <,> before rendering
It doesn’t prevent Cross-Site Scritpting attacks means any script saved in the database will be fired while rendering the page
Razor View Engine doesn’t support design mode in Visual Studio like you can’t see page look and feel (Design mode)
ASPX Engine support Design mode to see page look and feel with the running application.

No comments :

Post a Comment