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
Arrow up icon
GO TO TOP
Mastering Blazor WebAssembly

You're reading from   Mastering Blazor WebAssembly A step-by-step guide to developing advanced single-page applications with Blazor WebAssembly

Arrow left icon
Product type Paperback
Published in Aug 2023
Publisher Packt
ISBN-13 9781803235103
Length 370 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ahmad Mozaffar Ahmad Mozaffar
Author Profile Icon Ahmad Mozaffar
Ahmad Mozaffar
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Part 1: Blazor WebAssembly Essentials
2. Chapter 1: Understanding the Anatomy of a Blazor WebAssembly Project FREE CHAPTER 3. Chapter 2: Components in Blazor 4. Chapter 3: Developing Advanced Components in Blazor 5. Part 2: App Parts and Features
6. Chapter 4: Navigation and Routing 7. Chapter 5: Capturing User Input with Forms and Validation 8. Chapter 6: Consuming JavaScript in Blazor 9. Chapter 7: Managing Application State 10. Chapter 8: Consuming Web APIs from Blazor WebAssembly 11. Chapter 9: Authenticatiwng and Authorizing Users in Blazor 12. Chapter 10: Handling Errors in Blazor WebAssembly 13. Part 3: Optimization and Deployment
14. Chapter 11: Giving Your App a Speed Boost 15. Chapter 12: RenderTree in Blazor 16. Chapter 13: Testing Blazor WebAssembly Apps 17. Chapter 14: Publishing Blazor WebAssembly Apps 18. Chapter 15: What’s Next? 19. Index 20. Other Books You May Enjoy

Persisting the state using the URL

The URL is used mainly for navigation between the app pages, but we have already seen in Chapter 4, Navigation and Routing, how we can send data in the URL to other components and pages.

The same techniques we used, such as the routing parameters or query parameters to transfer data, are also used to keep the flow and the state of the app.

A common example that you may face in every app you build is having a page where there is a list of data to show, just like the Index page of our BooksStore app, which renders a list of books.

The list can be long, so pagination is the solution; each page shows a chunk of the books, and the user can navigate between the pages.

For a good user experience and to make the app easier to use, you need to keep the state of the current page that the user is navigating. When the user refreshes the page, shares the link, or opens it in another tab or browser, the same chunk of data will be listed, and the state...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime