C
C#2mo ago
Vektor

Updating Multiple instance of the same page in real time

What is the currently best way to achieve that in C# (be that .net core or mvc projects) without relying on third party / nuget tools ? For example: Pressing a button to create a cell will do it across all instance of the same page be that 2 3 4 5 etc without having to refresh it.
18 Replies
Pobiega
Pobiega2mo ago
What exactly is an instance of a page here? Do you mean in multiple clients (aka browsers)?
Angius
Angius2mo ago
Like, Pobiega and I have coolapp.com/table open, you click a button, and we all see a new cell added? If, so then SignalR or some such
Pobiega
Pobiega2mo ago
If thats the case, SignalR would be the go-to answer, but thats a nuget
Angius
Angius2mo ago
With JS in the frontend Or Blazor
Vektor
Vektor2mo ago
Like let's say a simple page that adds something to it but if i have it open twice if i interact with one it updates on both
Pobiega
Pobiega2mo ago
SignalR.
Vektor
Vektor2mo ago
so if the client has multiple identical instance open they are all updated real time
Pobiega
Pobiega2mo ago
or Blazor, which uses SignalR/websockets under the hood
Vektor
Vektor2mo ago
i have to do it without third party tools / nu gets
Pobiega
Pobiega2mo ago
but then your entire FE is blazor, which may or may not be what you want
Vektor
Vektor2mo ago
is that possible ?
Pobiega
Pobiega2mo ago
its gonna be a nightmare, but sure
Vektor
Vektor2mo ago
:owodespair:
Pobiega
Pobiega2mo ago
just roll your own websocket implementation
Vektor
Vektor2mo ago
so websocket is the goto then?
Pobiega
Pobiega2mo ago
HTTP is entirely request/response based you cant do live updates or the server pushing anything with normal HTTP thats why websockets exist
Angius
Angius2mo ago
Does SignalR and/or Blazor count as 3rd party...? Well, you could technically do long/short polling Or even SSE So Websockets are not the only way
Vektor
Vektor2mo ago
hmmm Maybe SignalR could work with the requirements Thank you for the info / suggestion