Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Blazor WebAssembly by Example, 2e
Blazor WebAssembly by Example, 2e

Blazor WebAssembly by Example, 2e: Use practical projects to start building web apps with .NET 7, Blazor WebAssembly, and C# , Second Edition

eBook
$18.99 $27.99
Paperback
$34.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Table of content icon View table of contents Preview book icon Preview Book

Blazor WebAssembly by Example, 2e

Introduction to Blazor WebAssembly

Blazor WebAssembly is Microsoft’s new single-page application (SPA) framework for building interactive web applications on .NET Framework. Since it is built on .NET Framework, Blazor WebAssembly allows you to run C# code on the client as well as the server. Therefore, instead of being forced to write JavaScript on the client, we can now use C# everywhere.

Blazor is red hot!

Run C# on the client.

Goodbye, JavaScript!

In this chapter, we will explain the benefits of using the Blazor framework. We will introduce the three different Blazor hosting models and discuss both the advantages and disadvantages of each of them. Also, we will discuss the goals of WebAssembly and share where it is supported. Finally, we will guide you through the process of setting up your computer to complete the projects in this book.

In this chapter, we will cover the following topics:

  • Benefits of using the Blazor framework
  • Hosting models:
    • Blazor Server
    • Blazor Hybrid
    • Blazor WebAssembly
  • Differences between the Blazor hosting models
  • What is WebAssembly?
  • Setting up your PC

Benefits of using the Blazor framework

Using the Blazor framework offers several benefits. For starters, it is a free and open-source framework built on Microsoft’s robust and mature .NET Framework. Also, it is a SPA framework that uses Razor syntax and can be developed using Microsoft’s exceptional tooling. Finally, Microsoft is actively supporting and updating the Blazor framework. Let’s examine each of these benefits in detail in the following sections.

.NET Framework

The Blazor framework is built on .NET Framework. Therefore, anyone familiar with .NET Framework can quickly become productive using the Blazor framework. The Blazor framework leverages the robust ecosystem of .NET libraries and NuGet packages from .NET Framework. Also, since the code for both the client and server can be written in C#, the client and server can share code and libraries. For example, the client and server can share the application logic used for data validation.

Open source

The Blazor framework is open source. Since Blazor is a feature of the ASP.NET framework, all the source code for Blazor is available on GitHub as part of the dotnet/aspnetcore repository, which is owned by the .NET Foundation. The .NET Foundation is an independent, non-profit organization established to support the innovative, commercially friendly, open-source ecosystem around the .NET platform. The .NET platform has a strong community of over 100,000 contributions from more than 3,700 companies.

Since .NET Framework is free, this means that Blazor is also free. There are no fees or licensing costs associated with using Blazor, including for commercial use.

SPA framework

The Blazor framework is a SPA framework. As the name implies, a SPA is a web app that consists of a single page. The application dynamically rewrites the areas of the page that have changed instead of loading an entirely new page in response to each UI update. The goal is faster transitions that make the web app feel more like a native app.

When a page is rendered, Blazor creates a render tree that is a graph of the components on the page. It is like the Document Object Model (DOM) created by the browser. However, it is a virtual DOM. Updates to the UI are applied to the virtual DOM and only the differences between the DOM and the virtual DOM are rendered by the browser.

Razor syntax

Razor is the ASP.NET view engine used to create dynamic web pages with C#. Razor is a syntax for combining HTML markup with C# code that was designed for developer productivity. It allows the developer to use both HTML markup and C# in the same file.

Blazor web apps are built using Razor components. Razor components are reusable UI elements that contain C# code, markup, and other Razor components. Razor components are quite literally the building blocks of the Blazor framework. For more information on Razor components, refer to Chapter 2, Building Your First Blazor WebAssembly Application.

IMPORTANT NOTE

Razor Pages and MVC also use the Razor syntax. Unlike Razor Pages and MVC, which render the whole page, Razor components only render the DOM changes. One way to easily distinguish between them is that Razor components use the RAZOR file extension, while both MVC and Razor Pages use the CSHTML file extension.

The name of the Blazor framework has an interesting origin story. The term Blazor is a combination of the word browser and the word razor.

Awesome tooling

You can use either Microsoft Visual Studio or Microsoft Visual Studio Code to develop Blazor applications. Microsoft Visual Studio is an integrated development environment (IDE), while Microsoft Visual Studio Code is a lightweight, yet powerful, editor. They are both incredible tools for building enterprise applications. As an added bonus, there are versions of both tools that are available for free.

Supported by Microsoft

Although the Blazor framework is open source, it is maintained by Microsoft. They continue to make large investments in the future of Blazor. The following list includes features that Microsoft is actively working on adding to Blazor:

  • Hot reload improvements
  • Ahead-of-time (AOT) compilation performance improvements
  • Authentication improvements
  • Additional built-in components
  • Multithreading

There are many benefits associated with using the Blazor framework to develop web applications. Since it is built on .NET Framework, it enables developers to use the skills, such as C#, and the tools, such as Visual Studio, that they have already mastered. Also, since it is a SPA framework, Blazor web apps feel like native apps to the user. Finally, Microsoft is making a large investment in the future of Blazor.

Hosting models

As we mentioned earlier, Razor components are the building blocks of Blazor applications. Where those Razor components are hosted varies depending on the hosting model.

Blazor has three different hosting models:

  • Blazor Server
  • Blazor Hybrid
  • Blazor WebAssembly

The first hosting model that Microsoft released was Blazor Server. In this hosting model, the Razor components are executed on the server. The second hosting model that Microsoft released, and the topic of this book, is Blazor WebAssembly. In this hosting model, the Razor components are executed on the browser using WebAssembly. The newest hosting model is Blazor Hybrid. Blazor Hybrid allows you to build native client apps by hosting the Razor components in an embedded Web View control.

Each hosting model has its own advantages and disadvantages. However, they all rely upon the same underlying architecture. Therefore, it is possible to write and test your code independently of the hosting model.

The major differences between the hosting models concern where the code executes, latency, security, payload size, and offline support. The one thing that all the hosting models have in common is the ability to execute at near native speed.

Blazor Server

As we just mentioned, the Blazor Server hosting model was the first hosting model released by Microsoft. It was released as part of the .NET Core 3 release in September 2019.

The following diagram illustrates the Blazor Server hosting model:

Figure 1.1: Blazor Server

In this hosting model, the web app is executed on the server and only updates to the UI are sent to the client’s browser. The browser is treated as a thin client and all the processing occurs on the server. Therefore, this model requires a constant connection to the server. When using Blazor Server, UI updates, event handling, and JavaScript calls are all handled over an ASP.NET Core SignalR connection.

IMPORTANT NOTE

SignalR is a software library that allows the web server to push real-time notifications to the browser. Blazor Server uses it to send UI updates to the browser.

Advantages of Blazor Server

There are a few advantages of using Blazor Server versus using Blazor WebAssembly. However, the key advantage is that everything happens on the server. Since the web app runs on the server, it has access to everything on the server. As a result, security and data access are simplified. Also, since everything happens on the server, the assemblies (DLLs) that contain the web app’s code remain on the server.

Another advantage of using Blazor Server is that it can run on thin clients and older browsers, such as Internet Explorer, that do not support WebAssembly.

Finally, the initial load time for the first use of a web app that is using Blazor Server can be much less than that of a web app that is using Blazor WebAssembly because there are much fewer files to download.

Disadvantages of Blazor Server

The Blazor Server hosting model has several disadvantages versus Blazor WebAssembly. The biggest disadvantage is that the browser must maintain a constant connection to the server. Since there is no offline support, every single user interaction requires a network roundtrip. As a result of all these roundtrips, Blazor Server web apps have higher latency than Blazor WebAssembly web apps and can feel sluggish. Also, network interruptions may cause a client to unexpectedly disconnect.

TIP

Latency is the time between the UI action and the time when the UI is updated.

Another disadvantage of using Blazor Server is that it relies on SignalR for every single UI update. Microsoft’s support for SignalR has been improving, but it can be challenging to scale. When too many concurrent connections to the server are open, connection exhaustion can prevent other clients from establishing new connections.

Finally, a Blazor Server web app must be served from an ASP.NET Core server.

Blazor Hybrid

The Blazor Hybrid hosting model is the most recent hosting model released by Microsoft. It was released as part of the .NET 6 release in November 2021.

The following diagram illustrates the Blazor Hybrid hosting model:

Figure 1.2: Blazor Hybrid

In this model, the Razor components run in an embedded Web View control. Blazor Hybrid apps include Windows Forms, WPF, and .NET MAUI apps. By using the Blazor Hybrid hosting model, your apps have full access to the native capabilities of the devices that you choose to target.

Advantages of Blazor Hybrid

The advantage of using this model versus Blazor WebAssembly is that it does not require WebAssembly. Also, since the component’s C# code is executed in the host process, the Blazor Hybrid apps have access to the native capabilities of the device.

Disadvantages of Blazor Hybrid

The major disadvantage of using Blazor Hybrid is that they are hosted in a Web View component in the native app. So, the developer must know how to develop each type of native client app that they want to target. Another disadvantage is that they usually require a server to deliver the app. In contrast, a Blazor WebAssembly app can be downloaded as a set of static files.

Blazor WebAssembly

The Blazor WebAssembly hosting model is the topic of this book.

Blazor WebAssembly 3.2.0 was released in May 2020. Blazor WebAssembly in .NET 5 was released as part of the .NET 5.0 release in November 2020. ASP.NET Core Blazor was released as part of the .NET 6.0 release in November 2021, and it is a long-term support (LTS) release. The most recent release of Blazor WebAssembly was released as part of the .NET 7 release in November 2022 This book will be using Blazor WebAssembly in .NET 7 for all the projects.

TIP

LTS releases are supported by Microsoft for at least 3 years after their initial release. Blazor WebAssembly in .NET 7 is a current release rather than an LTS release. Current releases get free support and patches for 18 months. We recommend that if you are starting a new project with Blazor WebAssembly, you should use the most recent release.

The following diagram illustrates the Blazor WebAssembly hosting model:

Graphical user interface, diagram, application

Description automatically generated

Figure 1.3: Blazor WebAssembly

In this hosting model, the web app is executed on the browser. For both the web app and the .NET runtime to run on the browser, the browser must support WebAssembly. WebAssembly is a web standard supported by all modern browsers, including mobile browsers. While Blazor WebAssembly itself does not require a server, the web app may require one for data access and authentication.

In the past, the only way to run C# code on the browser was to use a plugin, such as Silverlight. Silverlight was a free browser plugin provided by Microsoft. It was very popular until Apple decided to forbid the use of any browser plugins on iOS. As a result of Apple’s decision, Silverlight was abandoned by Microsoft.

IMPORTANT NOTE

Blazor does not rely on plugins or recompiling the code into other languages. Instead, it is based on open web standards and is supported by all modern browsers, including mobile browsers.

Advantages of Blazor WebAssembly

Blazor WebAssembly has many advantages. First, since it runs on the browser, it relies on client resources instead of server resources. Therefore, the processing is offloaded to the client. Also, unlike Blazor Server, there is no latency due to each UI interaction requiring a roundtrip to the server.

Blazor WebAssembly can be used to create a Progressive Web App (PWA). A PWA is a web app that looks and feels like a native application. They provide offline functionality, background activity, native API layers, and push notifications. They can even be listed in the various app stores. By configuring your Blazor WebAssembly app as a PWA, your app can reach anyone, anywhere, on any device with a single code base. For more information on creating a PWA, refer to Chapter 6, Building a Weather App as a Progressive Web App (PWA).

Finally, a Blazor WebAssembly web app does not rely on an ASP.NET Core server. In fact, it is possible to deploy a Blazor WebAssembly web app via a Content Delivery Network (CDN).

Disadvantages of Blazor WebAssembly

To be fair, there are some disadvantages when using Blazor WebAssembly that should be considered. For starters, when using Blazor WebAssembly, the .NET runtime, the dotnet.wasm file, and your assemblies need to be downloaded to the browser for your web app to work. Therefore, the first time you run a Blazor WebAssembly application it usually takes longer to initially load than an identical Blazor Server application. However, there are strategies that you can use to speed up the initial load time, such as deferring the loading of some of the assemblies until they are needed. Also, this is only an issue during the initial load since subsequent runs of the application will access the files from a local cache.

Another disadvantage of Blazor WebAssembly web apps is that they are only as powerful as the browser that they run on. Therefore, thin clients are not supported. Blazor WebAssembly can only run on a browser that supports WebAssembly. Luckily, due to a significant amount of coordination between the World Wide Web Consortium (W3C) and engineers from Apple, Google, Microsoft, and Mozilla, all modern browsers support WebAssembly.

Hosting model differences

The following table indicates the differences between the three models:

Blazor WebAssembly

Blazor Hybrid

Blazor Server

Native execution speed

X

X

X

Executes on client

X

X

Executes on server

X

Low latency after initial load time

X

X

Fast initial load time

X

Offline support

X

X

Does not require a server

X

Requires constant connection to a server

X

Can build PWAs

X

Assemblies sent to client

X

X

Assembles remain on server

X

Can access native client features

X

Requires WebAssembly

X

Requires SignalR

X

Can run on thin clients

X

Table 1.1: Hosting model differences

The Blazor framework provides three different hosting models, Blazor Server, Blazor Hybrid, and Blazor WebAssembly. A Blazor Server web app runs on the server and uses SignalR to serve the HTML to the browser. A Blazor Hybrid web app runs in a Web View control in the native app. A Blazor WebAssembly web app runs directly in the browser using WebAssembly. They each have their advantages and disadvantages. However, if you want to create interactive, highly responsive, native-like web apps that can work offline, we recommend Blazor WebAssembly. Let’s learn more about WebAssembly in the next section.

What is WebAssembly?

WebAssembly is a binary instruction format that allows code written in high-level languages, such as C#, to run on the browser at near-native speed. To run .NET binaries in a web browser, it uses a version of the .NET runtime that has been compiled to WebAssembly. You can think of it as executing natively compiled code in a browser.

WebAssembly is an open standard developed by a W3C Community Group. It was originally announced in 2015, and the first browser that supported it was released in 2017.

WebAssembly goals

When WebAssembly was originally being developed, there were four main design goals for the project. This is a list of the original goals for WebAssembly:

  • Fast and efficient
  • Safe
  • Open
  • Don’t break the web

WebAssembly is fast and efficient. It is designed to allow developers to write code in any language that can then be compiled to run in the browser. Since the code is compiled, it is fast and performs at near-native speed.

WebAssembly is safe. It does not allow direct interaction with the browser’s DOM. Instead, it runs in its own memory-safe, sandboxed execution environment. You must use JavaScript interop to interact with the DOM. The project in Chapter 5, Building a Local Storage Service Using JavaScript Interoperability (JS interop), will teach you how to use JavaScript interop.

WebAssembly is open. Although it is a low-level assembly language, it can be edited and debugged by hand.

WebAssembly didn’t break the web. It is a web standard that is designed to work with other web technologies. Also, WebAssembly modules can access the same Web APIs that are accessible from JavaScript.

Overall, WebAssembly was able to meet all of the original goals and rapidly gained support from all of the modern browsers.

WebAssembly support

As mentioned earlier, WebAssembly runs on all modern browsers, including mobile browsers. As you can see from the following table, all current versions of the most popular browsers are compatible with WebAssembly:

Browser

Version

Microsoft Edge

Current

Mozilla Firefox, including Android

Current

Google Chrome, including Android

Current

Safari, including iOS

Current

Opera, including Android

Current

Microsoft Internet Explorer

Not Supported

Table 1.2: WebAssembly browser compatibility

IMPORTANT NOTE

Microsoft Internet Explorer is no longer supported by Microsoft as of June 15, 2022. It does not support WebAssembly and will never support WebAssembly.

WebAssembly is a web standard that allows developers to run code written in any language in the browser. It is supported by all modern browsers.

Now that we have discussed the benefits of using the Blazor framework and compared the various hosting models, it’s time to start developing using the Blazor WebAssembly framework. However, before we can get started, you need to set up your PC.

Setting up your PC

For the projects in this book, we use Microsoft Visual Studio Community 2022, .NET 7, Microsoft SQL Server 2022 Express Edition, and Microsoft Azure.

All the projects are built using Microsoft Visual Studio Community 2022 (64-bit) – Current Version 17.4.2 with the ASP.NET and Web Development workload. If you need to install Microsoft Visual Studio Community 2022, follow the directions in the Installing Microsoft Visual Studio Community Edition section later in this chapter.

TIP

Although we are using Microsoft Visual Studio Community 2022, any edition of Microsoft Visual Studio 2022 can be used to complete the projects in this book. Microsoft Visual Studio Code can also be used. However, all the screenshots are from Microsoft Visual Studio Community 2022.

Blazor WebAssembly in .NET 7 requires .NET 7.0. To determine the version of .NET that is running on your computer, open Command Prompt and enter the following command:

dotnet –-version

If your computer is not running .NET 7.0 or higher, follow the directions in the Installing .NET 7.0 section later in this chapter.

Chapters 3 and 10 use Microsoft Azure. Chapter 3 uses Microsoft Azure to publish a Blazor WebAssembly application and Chapter 10 uses Microsoft Azure Active Directory to secure a Blazor WebAssembly application.

The final two projects in this book use Microsoft SQL Server 2022 Express Edition as the backend database. If you need to install Microsoft SQL Server Express Edition, follow the directions in the Installing Microsoft SQL Server Express section later in this chapter.

TIP

Although we are using Microsoft SQL Server 2022 Express Edition, any year or edition of SQL Server can be used to complete the projects in this book.

Installing Microsoft Visual Studio Community Edition

Microsoft Visual Studio Community Edition is the free edition of Microsoft Visual Studio. To install Microsoft Visual Studio Community Edition, perform the following steps:

  1. Download the Visual Studio installer from https://visualstudio.microsoft.com.
Text

Description automatically generated

Figure 1.4: Download Visual Studio selector

  1. Once the download is complete, run the installer to complete the installation.
  2. During the first step in the installation process, the Visual Studio installer will check the system for existing versions of Visual Studio. Once the installer has finished checking for installed versions, it will open the following installation dialog:
Graphical user interface, application

Description automatically generated

Figure 1.5: The Visual Studio installer

  1. Select the ASP.NET and web development workload and click the Install button to complete the installation.

Installing .NET 7.0

To install .NET 7.0, perform the following steps:

  1. Download the .NET 7.0 installer from https://dotnet.microsoft.com/download/dotnet/7.0. We are using the Windows x64 SDK Installer.
  2. Once the download completes, run the installer to complete the installation of .NET 7.0 on your computer.
  3. Open Command Prompt and enter the following command to verify that your computer is now running .NET 7.0:
    dotnet –-version
    

    The following screenshot is from a computer that is running .NET 7.0:

    Graphical user interface, text, application

Description automatically generated

    Figure 1.6: .NET version

Installing Microsoft SQL Server Express

Microsoft SQL Server Express is the free edition of Microsoft SQL Server. To install Microsoft SQL Server Express, do the following:

  1. Download the Microsoft SQL Server installer for SQL Server Express from https://www.microsoft.com/en-us/sql-server/sql-server-downloads.
  2. After the download completes, run the SQL Server installer.
  3. Select the Basic installation type:
Graphical user interface

Description automatically generated

Figure 1.7: The SQL Server installer

  1. Click the Accept button to accept the Microsoft SQL Server License Terms.
  2. Click the Install button to complete the installation.

    The following screenshot shows the dialog that appears after SQL Server Express has been successfully installed:

    Figure 1.8: SQL Server Express Edition

Create a Microsoft Azure account

Microsoft Azure is Microsoft’s cloud platform and it offers over 200 products and cloud services. You can use it to run and manage applications with the tools and frameworks of your choice.

If you do not already have a Microsoft Azure account, you can create a free account. Each free account comes with a generous $200 credit to get you started and over 55+ free services.

Graphical user interface, application

Description automatically generated

Figure 1.9: Microsoft Azure

To create a free Microsoft Azure account, do the following:

  1. Navigate to the Microsoft Azure page, https://azure.microsoft.com/.
  2. Click the Free account button.
  3. Click the Start free button.
  4. Complete the agreement and click the Sign up button.

To complete all the projects in this book, you will need a code editor, such as Microsoft Visual Studio Community 2022, .NET 7.0, Microsoft Azure, and Microsoft SQL Server. In this chapter, we showed you how to install Visual Studio 2022 Community Edition, .NET 7.0, and SQL Server 2022 Express Edition. We also showed you how to open a free Microsoft Azure account.

Summary

After completing this chapter, you should understand the benefits of using Blazor WebAssembly versus other Blazor hosting models and be prepared to complete the projects in this book.

In this chapter, we introduced the Blazor framework. The Blazor framework is built on .NET Framework and allows web developers to use C# on both the client and the server of a web app.

After that, we compared Blazor WebAssembly with both Blazor Server and Blazor Hybrid. All three hosting models are used to host Razor components. They each have their own advantages and disadvantages. We prefer Blazor WebAssembly.

In the last part of the chapter, we explained how to set up your computer with Microsoft Visual Studio Community Edition, .NET 7.0, and Microsoft SQL Server Express and how to open a Microsoft Azure account, all of which are required to complete the projects in this book.

Now that your computer is set up to complete the projects in this book, it is time to get started. In the next chapter, you will create your first Blazor WebAssembly web app.

Questions

The following questions are provided for your consideration:

  1. Which of the following hosting models requires a constant connection to a server: Blazor WebAssembly, Blazor Server, or Blazor Hybrid?
  2. Does using Blazor WebAssembly mean that you will never need to write JavaScript ever again?
  3. Does Blazor WebAssembly require any plugins to be installed on the browser?
  4. How much does it cost to get started developing with Blazor WebAssembly?

Further reading

The following resources provide more information concerning the topics in this chapter:

Join our community on Discord

Join our community’s Discord space for discussions with the author and other readers:

https://packt.link/BlazorWASM2e

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Explore and build complete, easy-to-follow web projects using Blazor. Each project includes a video example too.
  • Test your skills in building a weather app, an expense tracker, and a Kanban board with real-world applications.
  • Develop a deeper understanding on how to work with Blazor WebAssembly without spending too much time focusing on the theory.

Description

Blazor WebAssembly helps developers build web applications without the need for JavaScript, plugins, or add-ons. With its continued growth in popularity, getting started with Blazor now can open doors to new career paths and exciting projects – and Blazor WebAssembly by Example will make your first steps easier. This is a project-based guide that will teach you how to build single-page web applications with Blazor, focusing heavily on the practical over the theoretical by providing detailed step-by-step instructions for each project. The author also includes a video for each project showing her following the step-by-step instructions, so readers can use them if they're unsure about any particular step. In this updated edition, you'll start by building simple standalone web applications and gradually progress to developing more advanced hosted web applications with SQL Server backends. Each project will cover a different aspect of the Blazor WebAssembly ecosystem, such as Razor components, JavaScript interop, security, event handling, debugging on the client, application state, and dependency injection. The book’s projects get more challenging as you progress, but you don’t have to complete them in order, which makes this book a valuable resource for beginners as well as those who just want to dip into specific topics. By the end of this book, you will have experience and lots of know-how on how to build a wide variety of single-page web applications with .NET, Blazor WebAssembly, and C#.

Who is this book for?

This book is for .NET web developers who want to leverage the power of .NET and C# to write single-page web applications using Blazor WebAssembly without using JavaScript frameworks. To get started with this book, you’ll need at least beginner-level knowledge of the C# language, .NET framework, Microsoft Visual Studio, and web development concepts.

What you will learn

  • Discover the power of the C# language for both server-side and client-side web development
  • Build your first Blazor WebAssembly application with the Blazor WebAssembly App project template
  • Learn how to debug a Blazor WebAssembly app, and use ahead-of-time compilation before deploying it on Microsoft's cloud platform
  • Use templated components and the Razor class library to build and share a modal dialog box
  • Learn how to use JavaScript with Blazor WebAssembly
  • Build a progressive web app (PWA) to enable native app-like performance and speed
  • Secure a Blazor WebAssembly app using Azure Active Directory
  • Gain experience with ASP.NET Web APIs by building a task manager app

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Feb 28, 2023
Length: 438 pages
Edition : 2nd
Language : English
ISBN-13 : 9781803247533
Vendor :
Microsoft
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning

Product Details

Publication date : Feb 28, 2023
Length: 438 pages
Edition : 2nd
Language : English
ISBN-13 : 9781803247533
Vendor :
Microsoft
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 149.97
Web Development with Blazor
$69.99
Mastering Blazor WebAssembly
$44.99
Blazor WebAssembly by Example, 2e
$34.99
Total $ 149.97 Stars icon

Table of Contents

14 Chapters
Introduction to Blazor WebAssembly Chevron down icon Chevron up icon
Building Your First Blazor WebAssembly Application Chevron down icon Chevron up icon
Debugging and Deploying a Blazor WebAssembly App Chevron down icon Chevron up icon
Building a Modal Dialog Using Templated Components Chevron down icon Chevron up icon
Building a Local Storage Service Using JavaScript Interoperability (JS Interop) Chevron down icon Chevron up icon
Building a Weather App as a Progressive Web App (PWA) Chevron down icon Chevron up icon
Building a Shopping Cart Using Application State Chevron down icon Chevron up icon
Building a Kanban Board Using Events Chevron down icon Chevron up icon
Uploading and Reading an Excel File Chevron down icon Chevron up icon
Using Azure Active Directory to Secure a Blazor WebAssembly Application Chevron down icon Chevron up icon
Building a Task Manager Using ASP.NET Web API Chevron down icon Chevron up icon
Building an Expense Tracker Using the EditForm Component Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Most Recent
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.2
(21 Ratings)
5 star 71.4%
4 star 9.5%
3 star 4.8%
2 star 0%
1 star 14.3%
Filter icon Filter
Most Recent

Filter reviews by




Franck Jan 03, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
An excellent book that gradually guides us in building applications while incorporating the necessary skills to execute a project from start to finish. I highly recommend it
Subscriber review Packt
Volkan Uzun Nov 26, 2023
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
I dont think this book follows a plan to teach Blazor , it jumps from one topic to another; and all chapters are like: ok copy paste this code , boom it works; now next chapter. What did we copy? What do these commands do? no explanation; you can as well pick a project from GitHub that is developed with Blazor and copy paste to Visual Studio.
Amazon Verified review Amazon
Ross Jun 25, 2023
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
.Net is now cross platform, so please do not use Visual Studio in the projects in the future.
Amazon Verified review Amazon
peter de tender - Business Program Manager - Azure Technical Trainer at Microsoft Jun 07, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
WOW, I was impressed by this book, in a very positive way!!Being new to developing, I picked up Blazor and dotnet about 18 months back. I used a lot of material that's available online (MSLearn, YouTube, Blazor books,...) and learned from each and every one. Once I thought I read through all available ones, I found this one.Honestly, it's like Level400 content to me. Although Toi does a great job in starting with the basics, deploying the default template scenario and gradually building up the level of complexity in each chapter, I sometimes had to go back and go through a previous chapter, to make sure I got all the understandings correct.After going through all the chapters, the guidelines and all the amazing hands-on exercises, I am starting to see the concept of the book. It is for both beginners (in Blazor, not junior developers overall), but will turn you into an expert at the end of the book. The book is packed with so much useful information, I could apply in my real-life scenario development right away.The chapters sticking to mind for me were Chapter 3, debugging (not something I have seen in other Blazor books a lot, so kudos!), Chapter 7, using application state concepts in a shopping cart scenario, Chapter 10 on Identity integration,... but I don't want to break down any of the other chapters, as they are equally good.Even if you are looking for just a specific example on how to use Blazor, you don't have to read through the book cover to cover, but you can pick out the specific chapter/sample scenario that's of use to you (but again, I would definitely recommend going through the book cover to cover - you won't regret).As this was written with .NET7 in mind, it is very up-to-date, where the scenarios are just working,... so an excellent learning experience for sure!
Amazon Verified review Amazon
Ramneek Apr 28, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Over the past three weeks, I have been delving deeper into the world of Microsoft Blazor, and today I am thrilled to announce that I have just finished reading "Blazor WebAssembly" by author Toi B. Wright. This comprehensive guide is an excellent resource for web developers looking to build powerful web applications using Blazor #WebAssembly, a robust framework offered by #Microsoft. With a foreword by @Scott Hanselman and published by @packt, the book provides step-by-step instructions for building practical applications, such as Local Storage Services, Progressive Web App (PWA), Shopping Cart, Kanban Board, Expense Tracker, and more. By following the clear explanations and examples laid out in this book, readers will gain a solid understanding of Blazor and be equipped with the knowledge needed to create real-world web applications with ease. Whether you are a seasoned developer or just starting out, "Blazor WebAssembly" is a must-read for anyone interested in web development with Blazor.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.