Blazor component flow

AmaraCode LLC 261 Reputation points
2021-01-10T08:28:52.163+00:00

I'm building a Blazor (server) application. On a user (test) screen I have a button that reads information stored in Redis and displays on the screen. What I don't understand is that I have to click the button twice for the screen to update.

Here is the screen upon load:
55007-image.png

If I click the "Read UserInfo From Redis" button it feels like nothing happens. If I click the button again then I get the data on the screen.

54979-image.png

Can someone educate me on what I am doing wrong?

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,595 questions
{count} votes

Accepted answer
  1. AmaraCode LLC 261 Reputation points
    2021-01-16T14:10:35.657+00:00

    I found the answer to my question. If I add this to my Razor component then I get the desired results

        protected override bool ShouldRender()
        {
            var renderUI = true;
    
            return renderUI;
        }
    
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.