This is a old post that I recently found on ScottGu’s Blog. This a great article giving basics of the writing a  ASP.Net MVC Application using the new Razor syntax.

Introducing “Razor” – a new view engine for ASP.NET –  Scott Gu

Some Excerpts:

You denote the start of a code block with Razor using a @ character.  Unlike <% %> code nuggets, Razor does not require you to explicitly close the code-block:

image

Like our foreach example above, you can embed content within if statements (or any other C# or VB language construct), without having to be explicit about the code block’s begin/end.  For example:

image

Related Links

Related articles

Advertisements

One thought on “Introducing “Razor” – a new view engine for ASP.NET

  1. Pingback: ASP | ITgid

Share your thoughts

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s