Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#ASP.NETMVC
Hi,
 
i have no idea what is the difference between Razor view Engine and Asp.Net Engine and
what are the disadvantages of Asp.net.
why Viewstate is disadvantage of ASp.Net please give me full on it.
                     Tanking you.
Posted 28-Feb-12 19:37pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Read more here[^] and here[^].
 
This[^] might give some additional information as well.
  Permalink  
v2
Rate this: bad
good
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 Asp.net MVC that is included with Asp.net MVC from the beginning.
 
2. 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.
 
3. Web Form Engine has the same syntax like Asp.net Web Forms uses for .aspx pages.
 
4.
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:
 
 <%: 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.
  Permalink  
Comments
dholakiya ankit at 10-Aug-13 7:16am
   
nice one
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

The main differences is the script you are using in asp.net 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:http://ironshay.com/post/The-Big-View-Engine-Comparison-e28093-Razor-vs-Spark-vs-NHaml-vs-Web-Forms-View-Engine.aspx[]
 
We know that HTTP is state less, It is not able to store the any information once the form is posted to server although asp.net even we are postback the form to sever It preserve the status of each sever side control

The asp.net is using viewstate to preserve the asp.net control's status on post back.
asp.net 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
  Permalink  
Comments
Madhugundi at 1-Mar-12 4:54am
   
Thank you
Rate this: bad
good
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
  Permalink  
v2
Comments
Madhugundi at 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
Your Filters
Interested
Ignored
     
0 Guruprasad.K.Basavaraju 490
1 Shai Vashdi 339
2 Sergey Alexandrovich Kryukov 291
3 Peter Leow 135
4 praveen_07 115
0 Sergey Alexandrovich Kryukov 9,185
1 OriginalGriff 5,335
2 Peter Leow 4,040
3 Maciej Los 3,540
4 Abhinav S 3,308


Advertise | Privacy | Mobile
Web04 | 2.8.140415.2 | Last Updated 10 Aug 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid