Remark : Razor Syntax simple
1 2 3 4 |
<h1>Razor syntax demo</h1> <h2>@DateTime.Now.ToShortDateString()</h2> |
Output:
Razor syntax demo
2021-03-12
1 2 3 4 5 6 7 8 |
@{ var date = DateTime.Now.ToShortDateString(); string message = "Hello World!"; <text>Today's date is:</text> @date <br /> @message } |
1 2 3 4 5 6 7 8 |
@{ var date = DateTime.Now.ToShortDateString(); string message = "Hello World!"; @:Today's date is: @date <br /> @message } |