ttmind

Main Navigation

ttmind
  • jim-jams
  • Tech
  • Positive
Login

Login

Facebook Google

OR

Remember me Forgot password?

Don't have account? Signup here.

Sort by Categorys

.Net

PHP

Java

JavaScript

Database

Server

Client Side

Tools

Artificial Intelligence

Cloud

Hybrid Development

Event

Smart City

Education

Security

Scrum

Digital Marketing

APP Development

Business

Internet

Simulation

Art

Network

Microservices

Architecture

Technology

Leadership

    Top Articles

  • How Does Social Media Bring People Together?
    TTMind Author
  • How to read appSettings JSON from Class Library in ASP.NET Core
    Anil Shrestha
  • Printing Support In Asp.Net Core
    TTMind Author
  • HOW TO EXTRACT TEXT FROM IMAGE USING JAVASCRIPT (OCR with Tesseract.js)?
    Prakash Pokhrel
  • Images Upload REST API using ASP.NET Core
    Prakash Pokhrel
  • Related Topic

  • How to read appSettings JSON from Class Library in ASP.NET Core
  • Printing Support In Asp.Net Core
  • Images Upload REST API using ASP.NET Core
  • How to use IActionFilter, IAsyncActionFilter in ASP.NET Core MVC?
  • ASP.NET CORE - Blazor CRUD operation using ADO.NET
  • Tech
  • About Us
  • Contact Us
  • TechHelp
  • PositiveHelp
  • Jim-Jams Help
  • Terms & Conditions

© Copyright ttmind.com

Main Content

Difference between ASPX and Razor View Engine in .Net

.Net .Net Core about 7 years ago || 2/8/2019 || 2.4 K View

  • Hide

View Engine in .NET is responsible for rendering your code into good looking Interface. MVC uses the views to locate and render the views we are requesting from the controller through asp action. Views can contain server controls, html tags and can have programming code.

There are many view engine available like

  • ASPX
  • Razor
  • Spark
  • NHaml
  • NDJango
  • Hasic
  • and many more

But most of the programmers prefer to user Razor view due to its convenience

There are Two View Engines used in Dot NET Framework.

  • ASPX view engine and
  • RAZOR view engine

There are some differences between ASPX View Engine and RAZOR View Engines . They are provided below :-

  ASPX View Engine:

  • ASPX/Web Form View Engine is a default view engine for MVC 1 and MVC 2 template.

  • The Namespace for ASPX/Web Form engine is System.Web.mvc.Web Form view engine.

  • Master Page is used with ASPX view Engine.

  • ASPX View Engine has extensions like .aspx for the views, .acsx for UserControls and .master for Master Pages as in simple web application.

  • In ASPX/ Web Form, we can use WebUserControls (.ascx).

  • ASPX view engine works faster in comparison to Razor view engine.

  • <% ..%> Character is used for writing the ASPX view engine code. For Eg. <%Html.ActionLink ("Login”, login_page") %>    

  • It supports design mode means you can see your page look and feel without running the mvc application

  • ASPX view Engine Does not Support Test Driven Development (TDD).This is more Complex unit testing.

  • ASPX/Web Form syntax are difficult to learn in comparison to Razor view.

  • ASPX View engine completely depends on System.web.UI.Page class.

RAZOR View Engine:

  • Razor view engine is an advanced view engine which was introduced with MVC 3 . Razor view engine is default view engine in MVC 3 template.It is a Markup Syntax and not a language.

  • The Namespace for Razor view engine is System.Web.Razor

  •  Layouts can be used with Razor View engine.

  • Razor View Engine has .cshtml (with C#) and .vbhtml (with VB) extension for views, Layout and Partial views.

  •  We can't use WebUserControls with Razor view engine.  

  • Razor view engine is a bit slower in comparison to ASPX engine.

  • The character @ is used with Razor view engine.   Ex. @Html.ActionLink ("SignUp","Reg_page")

  • It doesn’t support design mode in visual studio, means you can't see your page without running the application.

  • Razor view Engine Support Test Driven Development (TDD. This is simple in unit testing.

  • Razor syntax is easy to learn and clean than ASPX view engine.

  • Razor View engine does not depends on System.Web.UI.Page class.

 

Also Read: Learn about different Web Services

  • 1
  • 0
  • 0
    • Facebook
    • Twitter
    • Google +
    • LinkedIn

About author

Binod  Bhandari

Binod Bhandari

Life is not just about thrieving but all about living.

Reset Your Password
Enter your email address that you used to register. We'll send you an email with your username and a link to reset your password.

Quick Survey