top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Explain about Razor View Engine ?

+3 votes
350 views
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.

Example:

In the classic renderer in ASP.NET:

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

by Using Razor:

<ul>
@foreach(var userTicket in Model)
{
<li>@userTicket.Value</li>
}
<ul>
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 asp.net master pages. What is asp.net master pages equivalent, when using razor views?

+4 votes

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

...