Blazor

Print Print
Reading time 4:52

Blazor
Blazor.png
Original author(s)Microsoft
Developer(s).NET Foundation
Initial release2018; 3 years ago (2018)
Repositorygithub.com/dotnet/aspnetcore/tree/master/src/Components
Operating systemLinux, macOS, Windows
Included withASP.NET Core
TypeWeb framework
LicenseApache License 2.0
Websiteblazor.net

Blazor is a free and open-source web framework that enables developers to create web apps using C# and HTML.[1][2][3][4][5] It is being developed by Microsoft.

Overview

Five different editions of Blazor apps have been announced.

  • Blazor Server: These apps are hosted on an ASP.NET Core server in ASP.NET Razor format. Remote clients act as thin clients, meaning that the bulk of the processing load is on the server. The client's web browser downloads a small page and updates its UI over a SignalR connection. Blazor Server was released as a part of .NET Core 3.[6]
  • Blazor WebAssembly: Single-page apps that are downloaded to the client's web browser before running. The size of the download is larger than for Blazor Server, depends on the app, and the processing is entirely done on the client hardware. However, this app type enjoys rapid response time. As its name suggests, this client-side framework is written in WebAssembly, as opposed to JavaScript (while they can be used together).[7]

Microsoft plans to release Blazor PWA and Blazor Hybrid editions. The former supports progressive web apps (PWA). The latter is a platform-native framework (as opposed to a web framework) but still renders the user interface using web technologies (e.g. HTML and CSS). A third, Blazor Native – platform-native framework that renders a platform-native user interface – has also been considered but has not reached the planning stage.[6]

Support

Since version 5.0, Blazor has stopped working on some old web browsers, including Internet Explorer and the legacy version of Microsoft Edge.[8]

Example

The following example shows how to implement a simple counter that can be incremented by clicking a button:

<h1>Blazor code example</h1>
<p>count: @count</p>
<button class="btn btn-primary" @onclick="IncCount">Click to increment</button>

@code {
    private int count = 0;

    private void IncCount()
    {
        count++;
    }
}

See also

References

  1. ^ Strahl, Rick (31 July 2018). "Web Assembly and Blazor: Re-assembling the Web". Rick Strahl's Weblog. Self-published. Archived from the original on 22 October 2018.
  2. ^ Tomassetti, Federico (September 4, 2018). "Blazor: .NET in the Browser". tomassetti.me. Strumenta. Archived from the original on 22 October 2018.
  3. ^ James, Mike (12 February 2018). "Blazor .NET In The Browser". i-programmer.info. Self-published.
  4. ^ Miller, Jonathan (September 2018). "C# in the Browser with Blazor". MSDN Magazine. 33 (9). Archived from the original on 22 October 2018.
  5. ^ Roth, Daniel (22 March 2018). "Get started building .NET web apps that run in the browser with Blazor". ASP.NET Blog. Microsoft.
  6. ^ a b Roth, Daniel (10 October 2019). "Blazor Server in .NET Core 3.0 scenarios and performance". ASP.NET Blog. Microsoft.
  7. ^ Roth, Daniel (19 May 2020). "Blazor WebAssembly 3.2.0 now available". ASP.NET Blog. Microsoft. What is Blazor WebAssembly?.
  8. ^ Roth, Daniel (30 September 2020). "Updated Blazor browser support for .NET 5". dotnet/aspnetcore repo. Microsoft – via GitHub.com.

External links

By: Wikipedia.org
Edited: 2021-06-18 19:49:05
Source: Wikipedia.org