Home > DeveloperSection > Interviews > Why Razor when we already have ASPX?

Posted on    February-14-2016 10:35 PM

 1 Answer(s)
  381  View(s)
Rate this:

Anupam Mishra

Total Post:23

Posted on    February-14-2016 11:35 PM

Razor is a markup syntax that lets you embed server-based code into web pages.Razor is based on ASP.NET, and designed for creating web applications.It has the power of traditional ASP.NET markup, but it is easier to use, and easier to learn.
Razor is clean, lightweight, and syntaxes are easy as compared to ASPX. 
For example,
In ASPX to display simple time, we need to write:
In Razor, it’s just one line of code:

As per Microsoft, Razor is more preferred because it’s light weight and has simple syntax.

Don't want to miss updates? Please click the below button!

Follow MindStick