6/23/2019 8:46 PM
Microsoft’s Blazor is a framework for building rich interactive applications.
In a non-interactive web application, all interaction from the client (the web browser) requires events (like button clicks) and data to be communicated to the server, and the entire web page has to be reloaded to process the response.
- Slower – the page is repainted on each interaction
In a interactive web application, only interaction from the client that requires data from the server needs to be communicated to the server and the entire web page does not need to be reloaded to process the response, only required portions of the web page.
- Faster - the page is not repainted on each interaction
Note: Blazor runs in two modes (covered below), client-side Blazor and server-side Blazor. Server-side Blazor does interact with the server on each web browser event, however, the entire web page does not need to be reloaded so the speed on the application is usually just as fast as a client-side Blazor application.
Different Modes Of Blazor
Blazor applications can be created in different modes. You can chose the mode when creating a new Blazor project in Visual Studio.
Blazor (client-side) and the client project of the Blazor (ASP.NET Core Hosted) project template, creates a Blazor project that runs in WebAssembly, which is an open web standard, and supported in web browsers without plugins.
Blazor contains a number of features that facilitate rapid construction of modern rich interactive applications.
A Blazor application is composed of Components.
A Component is a chunk of code consisting of User Interface (UI) HTML markup and processing logic.
Blazor features One-way data binding…
… and Two-way data binding.
Components can be nested inside of other Components.
Components can pass parameters to other Components.
Components can raise events in other Components.
Routing in Blazor is as simple as declaring a @page directive.
A page can even have multiple routes.
Forms And Validation
Blazor also has the features that one would required for a web application such as Forms and Validation.
For example, we can create a class, decorate it with validation attributes, and the validation will be implemented simply by using a EditForm control, and a DataAnnotationsValidator, with a ValidationsSummary to display any errors.
Getting Started With Blazor
To get started with Blazor, download and install .Net Core 3.0 (or higher).
If using Visual Studio to develop applications, use the latest preview of Visual Studio 2019 (or higher).
For client-side Blazor, install the latest Blazor extension from the Visual Studio Marketplace.
2 comment(s) so far...
By BlazorFan on
6/28/2019 4:15 AM
Re: What Is Blazor
Hey Michael, great write-up.
Any chance you could redo your Azure AD example now that preview 6 is here?
By Michael Washington on
6/28/2019 4:18 AM
Re: What Is Blazor
@BlazorFan - I recommend using the built-in Authentication wizard in Visual Studio for Azure AD Authentication that came in the last release.