Click here to Skip to main content
13,092,862 members (67,204 online)
Rate this:
Please Sign up or sign in to vote.
See more:

i have no idea what is the difference between Razor view Engine and Asp.Net Engine and
what are the disadvantages of
why Viewstate is disadvantage of ASp.Net please give me full on it.
Tanking you.
Posted 28-Feb-12 19:37pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

Razor View Engine
1. 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.

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

3. Razor has new and advance syntax that are compact, expressive and reduces typing.

4. Razor syntax are easy to learn and much clean than Web Form syntax. Razor uses @ symbol to make the code like as:

@Html.ActionLink("SignUp", "SignUp")

5. Razor Engine support TDD (Test Driven Development) since it is not depend on System.Web.UI.Page class.

Web Form View Engine

1. Web Form Engine is the default view engine for the MVC that is included with MVC from the beginning.

2. The file extensions used with Web Form Engine are also like Web Forms. It has .aspx extension for views, .ascx extension for partial views & editor templates and .master extension for layout/master pages.

3. Web Form Engine has the same syntax like Web Forms uses for .aspx pages.

Web Form syntax are borrowed from 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") %>

5. Web Form Engine doesn't support TDD (Test Driven Development) since it depend on System.Web.UI.Page class which makes the testing complex.
dholakiya ankit 10-Aug-13 7:16am
nice one
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Read more here[^] and here[^].

This[^] might give some additional information as well.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

The main differences is the script you are using in engine "<%%>" and Razor view "@"

It is more easy to write code with Razor view as programmer not need to end the tag

programmer can easily add the scripting code with HTML code

as MVC is open source other view engines are also available like :Spark

The major differences are nothing but all those are develop to make programmer life easy

you can refer:[]

We know that HTTP is state less, It is not able to store the any information once the form is posted to server although even we are postback the form to sever It preserve the status of each sever side control

The is using viewstate to preserve the control's status on post back. added viewstate extra code for each server side control you used
It will increases the HTML code (response that send to client)and hit the performance of application
so it advisable to not to use the viewstate for the control which value not require to preserve on server postback
Madhugundi 1-Mar-12 4:54am
Thank you
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Diference between Razor and .aspx:
1.The ASP.NET view engines processes web pages, looking for special elements that contain server-side instructions. As we already know the standard ASPX view engine relies on the <% and %> elements, which is familiar to all ASP.NET developers. But with Razor View Engine, the MVC development team has introduced a new set of syntax elements, centered on the @ symbol.
2. Razor views have a file extension of .cshtml.

Disadvantges of Viewstate:
1. Does not track across pages. ViewState information does not automatically transfer from page to page. With the session
approach, values can be stored in the session and accessed from other pages. This is not possible with ViewState, so storing
data into the session must be done explicitly.

2. ViewState is not suitable for transferring data for back-end systems. That is, data still has to be transferred to the back
Madhugundi 1-Mar-12 4:54am
Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.170813.1 | Last Updated 10 Aug 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100