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