TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Look at Razor
Sateesh Arveti
Aug 28, 2010
10.8
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
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
Look at Razor
Next Recommended Reading
How to Create Razor Function in Asp.Net MVC View?