Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
A parent and child component demonstrating event callbacks.
# blazor/demo/EventCallback.razor
<ChildComponent OnNotify="HandleNotification" />
<p>@message</p>
@code {
private string message = "Waiting for notification...";
private void HandleNotification(string msg) {
message = msg;
}
}
// ChildComponent.razor
<button @onclick="NotifyParent">Notify Parent</button>
@code {
[Parameter] public EventCallback<string> OnNotify { get; set; }
private async Task NotifyParent() {
await OnNotify.InvokeAsync("Notification received!");
}
}Blazor WebAssembly (WASM) is a client-side web framework from Microsoft that allows developers to build interactive web applications using C# and .NET instead of JavaScript. Applications run directly in the browser via WebAssembly.
Origin & Creator
Blazor was developed by Microsoft, first introduced in 2018, with WebAssembly support added to enable fully client-side .NET applications.
Industrial Note
Blazor WASM is ideal for enterprises and developers invested in the Microsoft ecosystem who want C# web development without relying on JavaScript frameworks.