MVC3 -Razor syntax sample

Implicit Code Expression


Explicit Code Expression


Unencoded Code Expression


Code Block


int x = 123;

string y = “because.”;


Combining Text and Markup

@foreach (var item in items) {

 <span>Item @item.Name.</span>


Mixing Code and Plain Text

@if (showMessage) {

 <text>This is plain text</text>



@if (showMessage) {

 @:This is plain text.


Escaping the Code Delimiter

My Twitter Handle is &#64;hacked


My Twitter Handle is @@haacked

Server Side Comment


 This is a multiline server side comment.

 @if (showMessage) {



 All of this is commented out.


Calling a Generic Method


6/4/2013 5:31:46 PM #

hd pvr

Thanks for the auspicious writeup. It actually was a entertainment account it. Look complex to more added agreeable from you! However, how can we keep up a correspondence?

my website ...  hd pvr -

hd pvr