Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
ASP.NET

Razor Syntax in MVC

Embed C# in markup with @ expressions and code blocks.

Razor Syntax in MVC — a practical guide to ASP.NET MVC Razor syntax with clear examples you can reuse in real projects.

ASP & ASP.NET Tutorial Series (98/247). Prefer one article? Read the complete ASP.NET tutorial.

Short description

HTML encode by default with @value.

Razor

@model ItemVm
<h1>@Model.Name</h1>
@if (Model.IsActive) { <span>Active</span> }

Leave a reply

Your email address will not be published. Required fields are marked *