Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Blazor WebAssembly by Example
  • Table Of Contents Toc
Blazor WebAssembly by Example

Blazor WebAssembly by Example - Third Edition

By : Toi B. Wright
close
close
Blazor WebAssembly by Example

Blazor WebAssembly by Example

By: Toi B. Wright

Overview of this book

Blazor WebAssembly allows you to build web apps without the need for JavaScript, plugins, or add-ons. With its continued growth in popularity, Blazor WebAssembly can open doors to new career paths and exciting projects, and Blazor WebAssembly by Example makes getting started easy. This project-based guide teaches you how to build single-page web applications by focusing heavily on the practical over the theoretical. The author provides step-by-step instructions for each project as well as a video of her following those exact steps. In this updated edition, we've added two new chapters on integrating artificial intelligence into web apps built with Blazor WebAssembly. You'll start with simple standalone web apps and gradually progress to hosted web applications with SQL Server backends. Each project covers a different concept from the Blazor WebAssembly ecosystem, such as Razor components, JavaScript interop, security, events, debugging, state management, hosted applications, REST APIs, and AI. 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'll be building your own web apps with .NET and C# using Blazor WebAssembly.
Table of Contents (18 chapters)
close
close
15
Chapter 15: Unlock Access to the Code Bundle and the PDF Version
16
Other Books You May Enjoy
17
Index

Summary

You have created a Local Storage Service by using JS interop to invoke JavaScript functions from your Blazor WebAssembly application.

In this chapter, you learned why JavaScript remains essential and how to use the IJSRuntime abstraction to invoke JavaScript functions from .NET, both asynchronously and synchronously. You also learned how to invoke .NET methods from JavaScript functions. Finally, you learned how to persist data in the browser's localStorage.

You used the Blazor WebAssembly Standalone App project template to create the Local Storage Service. You added a couple of JavaScript functions to read and write the browser's localStorage. Then, you added a class to invoke those JavaScript functions. In the last part of the chapter, you tested your Local Storage Service by adding a collocated JavaScript file that displayed data in a JavaScript alert box.

One of the biggest benefits of using Blazor WebAssembly is that all the code runs entirely in the browser. This...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Blazor WebAssembly by Example
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist download Download options font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon