Explain about Razor View Engine ?

 Posted by Bharathi Cherukuri on 8/27/2012 | Category: ASP.NET MVC Interview questions | Views: 5977 | Points: 40

This Razor View engine is a part of new rendering framework for ASP.NET web pages.
ASP.NET rendering engine uses opening and closing brackets to denote code (<% %>), whereas Razor allows a cleaner, implied syntax for determining where code blocks start and end.


In the classic renderer in ASP.NET:

<% foreach (var userTicket in Model)
{ %>
<li><%: userTicket.Value %></li>
<% } %>

By using Razor:


@foreach (var userTicket in Model)

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response