How can I make it so that when I switch between "Blazor" pages, the information I registered in my list remain?

hamed farjad 40 Reputation points
2023-02-17T10:54:38.3433333+00:00

Screenshot (57)

When I try to switch between pages, the information I saved in the profile parent list is deleted and I can't access it on the profile page.

what should i do ?

(وقتی می‌خواهم بین صفحات جابه‌جا شوم، اطلاعاتی که در لیست "parent profile"ذخیره کرده‌ام حذف می‌شود و نمی‌توانم در صفحه نمایه به آن دسترسی داشته باشم.)

چی کار باید بکنم

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,665 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AgaveJoe 29,946 Reputation points
    2023-02-17T12:53:44.5966667+00:00

    You did not mention which version of Blazor you are using or source code so we have no idea how your code works. However, your question is related to state management and Blazor has tools for managing state. See the following reference documentation. Be sure to pick the Blazor version you are using.

    ASP.NET Core Blazor state management

    If you are still having problems after reading the official documentation, then share sample code that illustrates this problem. Explain the expected results and the actual results.


  2. Bruce (SqlWork.com) 72,841 Reputation points
    2023-02-17T16:54:10.0633333+00:00

    the list property needs to be moved up the component tree to a common parent. this common parent would pass a callback to its children which could be used to update the list or fetch the list

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.