Blog

Look at Razor

Aug 27, 2010 Blogs | ASP.NET Programming
Razor is a new view engine available in upcoming ASP.NET MVC release.
The new view engine will reduce number of characters to code and easy to learn. Let's see few examples using Razor:


In earlier version for Code blocks:
Hi  <%= id %> (or) <%= DateTime.Now.Month %>

In Razor:
@id (or) @DateTime.Now.Month

In earlier version for for loops:
<% for(int i=0; i< 10; i++) { %>
<p><%= i %> </p>
<% } %>

In Razor:

@for(int i=0; i< 10;i++){
<p>@i</p>
}

@id (or) @DateTime.Now.Month

For more details, refer: http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx
Sateesh Arveti

I hold Bachelors degree in Computer Science along with MCSD,MCTS and MVP for the year 2009. Areas of Interest: C#, WPF, WF, silverlight, ASP.NET, Oracle and SQL Server.

  • 57rank
  • 2M readers
  • 2times
COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs