Description #
Blazor is a web framework by Microsoft that allows developers to build interactive web UIs using C# instead of JavaScript.
History #
Blazor was introduced in 2018 by Microsoft as part of the ASP.NET ecosystem. It brought a unique approach to front-end development by enabling C# code to run in the browser using WebAssembly.
Hello World Code #
<h1>Hello, World!</h1>
<p>The current time is @DateTime.Now</p>
How to Run #
Option 1: Online
Try .NET Blazor
Option 2: Local
Install .NET SDK and run:
dotnet new blazorserver -o HelloBlazor
cd HelloBlazor
dotnet run
Key Concepts #
- C# instead of JavaScript
- WebAssembly-based runtime
- Server-side and client-side modes
- Component-based architecture
- Razor syntax
- SignalR-powered real-time updates
- Strong .NET integration
- Dependency Injection built-in
- Routing and form validation
- Tooling via Visual Studio or CLI
Try It Online #
https://blazorrepl.telerik.com
Fun Facts #
The name “Blazor” is a mix of “Browser” and “Razor,” referencing the HTML-like syntax used in .NET.