Created
March 19, 2015 17:42
-
-
Save flyingfisch/407d07c925ef37480d4c to your computer and use it in GitHub Desktop.
asp-net-razor-cheatsheet.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ASP.net Razor Cheatsheet | |
## Basics | |
### Including code in a view | |
``` | |
<!-- Single-statement blocks --> | |
@{ int myInt = 1; } | |
<!-- Inline expressions --> | |
<p>So there I was, with @numberOfDonuts donuts in front of me.</p> | |
<!-- Multi-statement blocks --> | |
@{ | |
int myInt = 1; | |
int myOtherInt = 2 + myInt; | |
} | |
<p>myInt is equal to @myInt</p> | |
``` | |
> Written with [StackEdit](https://stackedit.io/). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment