How does server-side Blazor work?

Server-side Blazor is executed on the server within an ASP.NET Core application. All UI updates, event handling, and JavaScript calls are handled from server by using a SignalR connection, even a button click will go to server. For more information regarding Blazor client-side and server-side apps, check this link.

How does client-side Blazor work?

Client-side Blazor makes use of WebAssembly, which is used to run high-level languages on browsers. Necessary .NET WebAssembly-related code and its dependencies are downloaded to the browser, and the app is executed directly on the browser UI thread. All UI updates and event handling occur within the same process.

How do you call a .NET function from JavaScript using JavaScript Interop?

There are two methods to call a method from JavaScript: DotNet.invokeMethod DotNet.invokeMethodAsync The syntax of calling a C# method from JavaScript is as follows. Add the .NET function invoke statement to a script in the head of Pages/_Host.cshtml file. Here we are defining a JavaScript function “CSMethod”. This function will have a callback to our .NET function “CSCallBackMethod” which is defined in index.razor. To invoke C# method from JavaScript, The method must be decorated with “JSInvokable” attribute. The method must be public. The method may either be static or instance-level (this is only supported by Blazor 0.5.0 and above). The Identifier for the method must be unique. The method must be nongeneric. Reference LinkReference link https://www.freecodecamp.org/news/how-to-implement-javascript-interop-in-blazor-9f91d263ec51/

How do you render a Blazor page after the parameter is updated?

Blazor updates the UI every time a parameter updates. Invoking an external StateHasChanged() might be required when updating parameters as a result of any async operation. [Counter.razor]  StateHasChanged tells Blazor to update the UI when it is called. https://stackoverflow.com/questions/55809117/blazor-page-not-rerendering-after-parameter-updated