Blazor Component Model
Create Razor components, understand the component lifecycle, use parameters and cascading values.
What Is Blazor?
Blazor lets you build interactive web UIs using C# instead of JavaScript. Components are defined in .razor files combining HTML markup and C# logic. Blazor runs on the server (Blazor Server) or in the browser via WebAssembly (Blazor WASM).
Your First Component
A Razor component is a .razor file with HTML markup and a @code block for C#. The component name becomes the HTML tag name.
@* Greeting.razor *@
<h2>Hello, @Name!</h2>
<p>You have @Count messages.</p>
@code {
[Parameter] public string Name { get; set; } = "World";
private int Count = 5;
}All lessons in this course
- Blazor Component Model
- Data Binding & Event Handling
- Component Communication & DI
- State Management in Blazor