What is Razor?

Submitted by: Administrator
-When we need to include our c# or VB code with the HTML markup within ASP.NET Web pages then sometimes it becomes very tedious. To overcome this problem, Razor was implemented.

-Razor was introduced with ASP.NET MVC 3 to make ease of writing C# or VB code in HTML pages.

-There is no need to use ASP.NET delimiter <%= %>. We can use only “@” character to achieve the same goal.

-For example
<%= DateTime.Now %>
Can be written in Razor simply as
@DateTime.Now

-In razor all syntax starts with “@” and if there is only one line of code then there is no need to use “{“.

-The extension of Razor file is cshtml for C# work environment and vbhtml for Visual Basic work environment.
Submitted by: Administrator

Read Online ASP.Net MVC Job Interview Questions And Answers