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:
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:
Related Links
- ASP.NET MVC 4 Beta : Official Microsoft Site
- Introducing “Razor” – a new view engine for ASP.NET
- ASP.NET MVC Samples
Related articles
- Scott Hunter Talks Visual Studio 11 and ASP.NET MVC 4 (channel9.msdn.com)