mvc razor tutorial
This tutorial explains razor syntax in asp.net MVC.
Razor is a markup syntax for embedding server-based code into webpages. The Razor syntax consists of Razor markup, C#, and HTML. Files containing Razor generally have a .cshtml file extension.
uses the @
symbol to transition from HTML to C#
لكي تكتب كود سي شارب في صفحة الهتمل الخاصة بك لابد ان تضع قبلها علامة
@
<p>@DateTime.Now</p>
وبالتالي تتعامل مع الكلينت سايد وهذا ما يميز هذه التقنية
حيث تكتب الكود عادي في الهتمل لمذيد من السرعة
@{
var theMonth = DateTime.Now.Month;
}