Getting Started with BlazorAmr Saafan
What is Blazor?
- Blazor is a new open-source and cross-platform framework developed by Microsoft’s ASP.NET team for building interactive client-side UI. It was first released in 2018.
- It is compatible with Windows, Linux, and macOS.
- Its name is derived from the words Browser and Razor.
- It is used to create web UI in client-side applications, and it makes use of WebAssembly support.
- Blazor allows us to use both advanced IDEs like Visual Studio and lightweight IDEs like Visual Studio Code.
- Blazer sources were kept in a separate repository until the Blazor was merged with ASP.NET 5.
- You can now find Blazor’s sources and issues in the ASP.NET Core Repo.
- Instead of installing a plugin or performing a transpile process, the C# code you write for client-side will work in all modern browsers with .NET Runtime Environment with the help of web assembly.
How it works?
Blazor components can be created by combining Razor syntax with .NET code. Instead of .cshtml files, Razor files are used for implementation. UI event handling, data binding, and rendering UI updates are simple to implement and work in tandem with Blazor components.
To create a Blazor web app, there are two hosting options:
Blazor components are executed on the ASP.NET Core app server in this hosting mode. The SignalR connection is used for all UI interactions and updates. Blazor Server apps are quick to load and simple to set up.
Relation With WebAssembly
It is a low-level assembly-like language with a compact binary format that allows code written in multiple languages, including C/C++, Java, and Rust, to run on the web with near-native performance.
Getting Started with Blazor Components
.razor files are used to create Blazor components.
Razor syntax is used in .razor files.
Things that can be done with using Blazor
Blazor provides developers with an alternative option for cross-platform desktop, web, and mobile application development. In this manner, The net usage area is expanding, as is the capacity for hybrid application development. To give a few examples, consider the following:
Single Page Application (SPA)
Blazor has made it possible for any C# developer to create an SPA application.
We will follow Microsoft’s developments in this field together.