Blazor WebAssembly by Example: A project-based guide to building web apps with .NET, Blazor WebAssembly, and C# (Paperback)

Wright, Toi B.



Discover blueprints that explore various components of Blazor, C#, and .NET to help you build web apps without learning JavaScript


Key Features:

  • Explore complete, easy-to-follow web projects using Blazor
  • Build projects such as a weather app, expense tracker, and Kanban board with real-world applications
  • Understand and work with Blazor WebAssembly effectively without spending too much time focusing on the theory


Book Description:

Blazor WebAssembly makes it possible to run C# code on the browser instead of having to use JavaScript, and does not rely on plugins or add-ons. The only technical requirement for using Blazor WebAssembly is a browser that supports WebAssembly, which, as of today, all modern browsers do. Blazor WebAssembly by Example is a project-based guide for learning how to build single-page web applications using the Blazor WebAssembly framework. This book emphasizes the practical over the theoretical by providing detailed step-by-step instructions for each project.


You'll start by building simple standalone web applications and progress to developing more advanced hosted web applications with SQL Server backends. Each project covers a different aspect of the Blazor WebAssembly ecosystem, such as Razor components, JavaScript interop, event handling, application state, and dependency injection. The book is designed in such a way that you can complete the projects in any order.


By the end of this book, you will have experience building a wide variety of single-page web applications with .NET, Blazor WebAssembly, and C#.


What You Will Learn:

  • Discover the power of the C# language for both server-side and client-side web development
  • Use the Blazor WebAssembly App project template to build your first Blazor WebAssembly application
  • Use templated components and the Razor class library to build and share a modal dialog box
  • Understand how to use JavaScript with Blazor WebAssembly
  • Build a progressive web app (PWA) to enable native app-like performance and speed
  • Understand dependency injection (DI) in .NET to build a shopping cart app
  • Get to grips with .NET Web APIs by building a task manager app


Who this book is for:

This book is for .NET web developers who are tired of constantly learning new JavaScript frameworks and wish to write web applications using Blazor WebAssembly, leveraging the power of .NET and C#. The book assumes beginner-level knowledge of the C# language, .NET framework, Microsoft Visual Studio, and web development concepts.



- 使用Blazor探索完整且易於遵循的Web項目
- 使用真實應用案例構建天氣應用程序、費用追蹤器和看板等項目
- 有效理解和使用Blazor WebAssembly,無需花費過多時間學習理論知識

Blazor WebAssembly使得在瀏覽器上運行C#代碼成為可能,而不需要使用JavaScript,也不依賴插件或附加組件。使用Blazor WebAssembly的唯一技術要求是支持WebAssembly的瀏覽器,而現代瀏覽器都已支持WebAssembly。《Blazor WebAssembly by Example》是一本基於項目的指南,教您如何使用Blazor WebAssembly框架構建單頁Web應用程序。本書強調實踐而非理論,為每個項目提供詳細的逐步指導。

您將從構建簡單的獨立Web應用程序開始,進而開發具有SQL Server後端的更高級的托管Web應用程序。每個項目都涵蓋Blazor WebAssembly生態系統的不同方面,例如Razor組件、JavaScript互操作、事件處理、應用程序狀態和依賴注入。本書設計得可以按任意順序完成這些項目。

通過閱讀本書,您將獲得使用.NET、Blazor WebAssembly和C#構建各種單頁Web應用程序的經驗。

- 發現C#語言在服務器端和客戶端Web開發中的威力
- 使用Blazor WebAssembly應用程序項目模板構建第一個Blazor WebAssembly應用程序
- 使用模板化組件和Razor類庫構建並共享模態對話框
- 理解如何在Blazor WebAssembly中使用JavaScript
- 構建漸進式Web應用程序(PWA),實現類似本地應用程序的性能和速度
- 理解.NET中的依賴注入(DI),構建購物車應用程序
- 通過構建任務管理器應用程序來掌握.NET Web API

本書適合.NET Web開發人員,他們厭倦了不斷學習新的JavaScript框架,希望使用Blazor WebAssembly編寫Web應用程序,充分利用.NET和C#的優勢。本書假設讀者具有初級水平的C#語言、.NET框架、Microsoft Visual Studio和Web開發概念知識。