Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Understanding How InteractiveServer Works in Blazor

$
0
0

I am trying to understand how InteractiveServer works in Blazor.

When using InteractiveServer, does it only re-render the variable currentCount to show the updated value, or does it re-render the entire page to reflect the updated currentCount?

Here is an example code snippet:

@page "/counter"@rendermode InteractiveServer<PageTitle>Counter</PageTitle><h1>Counter</h1><p role="status">Current count: @currentCount</p><button class="btn btn-primary" @onclick="IncrementCount">Click me</button>@code {    private int currentCount = 0;    private void IncrementCount()    {        currentCount++;    }}

The documentation does not clearly explain how InteractiveServer updates or re-renders the changed value Microsoft InteractiveServer documentation..

Can someone clarify this behavior?

I have been reading the Microsoft InteractiveServer documentation on InteractiveServer to understand its behavior.

I excepted the InteractiveServer to either:

  1. Only re-render the currentCount variable to reflect the updated count, or
  2. Re-render the entire page to reflect the updated currentCount.

However, the Microsoft InteractiveServer documentation does not specify which behavior occurs, and I haven't been able to determine this from my own testing.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>