top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Explain about Razor View Engine ?

+3 votes
Explain about Razor View Engine ?
posted Sep 2, 2015 by Shivaranjini

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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)
answer Oct 17, 2016 by Manikandan J
Similar Questions
+3 votes

How to import a namespace in Razor View Page?

+4 votes

When using aspx view engine, to have a consistent look and feel, across all pages of the application, we can make use of master pages. What is master pages equivalent, when using razor views?

+4 votes

When using razor views, do you have to take any special steps to proctect your mvc application from cross site scripting (XSS) attacks?