Get Started with Blazor in .NET 5

Take advantage of Blazor, Microsoft’s answer to full-stack development, to build rich web apps with C## and .NET Core.

Microsoft’s Blazor is an open source and cross-platform web UI framework used for developing single-page applications (SPAs) in .NET and .NET Core. Blazor is built on a flexible component model that allows for the development of rich, interactive web UIs.

You can take advantage of Blazor to build interactive Web UIs using C## in lieu of JavaScript. This means you can use C## for both server-side and client-side development. That said, you can still use JavaScript if you would like to. Blazor can invoke JavaScript functions and vice versa.

Also on InfoWorld: Entry-level software developer? Learn React to get that first job ]

Note that Blazor is included as part of .NET 5.0. Thus you have everything you need to build rich, modern web apps using .NET Core and C#. This article discusses how we can get started with Blazor in .NET 5.0.

To work with the code examples illustrated in this article, you should have Visual Studio 2019 installed in your system. If you don’t already have a copy, you can  download Visual Studio 2019 here.

Full-stack development with Blazor

Before Blazor, using .NET to build web applications meant combining the use of C## and JavaScript. Developers used C## to build APIs, business logic, and data access components and used JavaScript (or JavaScript frameworks such as Angular or React) to build the front-end of the application. Until Blazor, we didn’t have a single .NET technology stack that could be used for both server-side and client-side code.

Blazor is available in two models: client-side and server-side. The client-side model runs in the browser via WebAssembly and updates the DOM there, while the server-side model maintains a model of the DOM on the server and uses a SignalR pipeline to send diffs back and forth between the browser and the server.

#blazor

Get Started with Blazor in .NET 5