Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
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 Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
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
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

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 : 9781803241852
Vendor :
Microsoft
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Feb 28, 2023
Length: 438 pages
Edition : 2nd
Language : English
ISBN-13 : 9781803241852
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
Banner background image

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

Top Reviews
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
Top Reviews

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
Ryan Contento Mar 14, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is very well written and easy to follow. It is a fantastic place to start learning Blazor and will have you to the point where you can begin your own projects by the end. Lots of great examples to use as references as well. Highly recommend.
Amazon Verified review Amazon
Brian Barnett Apr 06, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Blazor WebAssembly By Example 2nd edition by Toi B. Wright is an exceptional book for developers who want to get started with Blazor WebAssembly, a modern and powerful framework for building web applications using .NET and C#.The book is structured in a very comprehensive manner, starting with the basics of Blazor WebAssembly, then gradually building up the reader's understanding of the framework with more advanced topics. The author provides clear explanations and code examples that make it easy for developers to follow along and implement the concepts they learn.One of the strengths of the book is the real-world examples provided throughout. Toi shows how to build a variety of applications, such as a calculator, a weather app, and a movie review app, each demonstrating various aspects of the framework. These examples help readers to understand how to apply what they learn to their own projects.The book covers a wide range of topics, including components, data binding, forms, validation, routing, and authentication. Additionally, it goes into detail on how to integrate Blazor WebAssembly with other technologies, such as ASP.NET Core and Entity Framework Core, which is particularly helpful for developers looking to build complex web applications.Overall, the book is an excellent resource for developers who want to learn how to build powerful web applications with Blazor WebAssembly. The book is well-written, easy to follow, and provides plenty of practical examples that will help readers to quickly gain a strong understanding of the framework. I highly recommend this book to any developer looking to get started with Blazor WebAssembly.
Amazon Verified review Amazon
Daniel Costea Apr 13, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
From time to time I like to go back to the basics by reading books like "Blazor WebAssembly byExample". I think this book is in the Goldilocks zone of introductory books as it offers a good balance between theoretical concepts and hands-on practice. I love that the author guides the audience through the learning steps, providing additional tips, notes, and references at the same time. If you are new to Blazor, this is definitely a great book to start with. If you're willing to keep up with the latest changes like me, I recommend it again, as this is another opportunity to migrate from other front-end frameworks to one that's more integrated with the .NET ecosystem.
Amazon Verified review Amazon
Christopher West Feb 28, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you're looking for a hands-on guide to building web applications with Microsoft's Blazor framework, "Blazor Web Assembly by Example" by Toi B. Wright is an excellent choice! The book is designed to help developers of all skill levels get up to speed quickly, with a series of practical examples that demonstrate key concepts and techniques.Starting with the basics of Blazor's architecture, the author guides you through the process of creating a simple application from scratch, step by step. As you work your way through the examples, you'll learn how to create components, handle data binding, implement validation, and even add authentication.One of the things I appreciate about this book is the author's emphasis on real-world application. Rather than just explaining the theory behind Blazor, she shows you how to use it to solve real problems. This makes the book especially helpful for developers who are new to Blazor and want to get up to speed quickly.Overall, "Blazor Web Assembly by Example" is a well-written and accessible guide to Blazor development. Whether you're a seasoned developer or just starting out, this book is sure to help you improve your skills and build better web applications. I highly recommend it!
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact [email protected] with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at [email protected] using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on [email protected] with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on [email protected] within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on [email protected] who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on [email protected] within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela