@{ var total = 7; } @{ var myMessage = "Hello World"; }The value of your account is: @total
The value of myMessage is: @myMessage
@{var greeting = "Welcome to our site!"; var weekDay = DateTime.Now.DayOfWeek; var greetingMessage = greeting + " Today is: " + weekDay; }The greeting is: @greetingMessage
@Html.Raw(model.Message) @:Model.Message (Not render html as a part of output
@foreach (var item in Model) {} @for (int i = 0; i < Model.ToList().Count(); i++) { @Model.ToList()[i].Age } @item.Message
@if (false) { @Model.Message; } else if (true) { @DateTime.Now; } else { @DateTime.Now; }
Razor automatically detect email idranmal.work@gmail.com
@@my name will print @my name
@*code here *@
Hello word @ViewBag.Message, How r u?
@(method)
Click Me Click Me