Author: you've been HAACKED | Posted on: 1/7/2011 2:13:13 AM | Views : 1023

I gave a presentation to another team at Microsoft yesterday on ASP.NET MVC and the Razor view engine and someone asked if there was a reference for the Razor syntax. It turns out, there is a pretty good guide about Razor available, but it's focused on covering the basics of web programming using Razor and inline pages and not just the Razor syntax. So I thought it might be handy to write up a a really concise quick reference about the Razor syntax. Syntax/Sample Razor Web Forms Equivalent (or remarks) Code Block @{ int x = 123; string y = "because." ; } <% int x = 123; string y = "because." ; %> Expression (Html Encoded) < span > @ model.Message </ span > < span > <% : model.Message %> <...(read more) ...

Go to the complete details ...