Home > OS >  how to get real time updates
how to get real time updates

Time:06-17

I have a service which returns status of the operation. Meaning when i add an entry to db it will be awaiting and then later after some approval this status will get updated to Approved,ndeclined etc. My requirement here is to update the Ui with these status updates. we usually put a timer inside our page in ASP.NET client, which calls the Web Service method or the Data access logic in every 5 seconds and the Ui get updated with the status.

Can you suggest any new functionality/library i can implement instead of the method mentioned above. I am using .net core and react in the front end.

CodePudding user response:

As the guys above said: You can handle an event of the list changing (using ObservableCollection) and do whatever you want, BUT probably as you got the changes real-time you also might want to pass this changes somewhere real-time (e.g. a web-page), so here comes the Signal-R technology which you can use to make real-time changes on your client's content.

Signal-R: https://docs.microsoft.com/el-gr/aspnet/core/tutorials/signalr?WT.mc_id=dotnet-35129-website&view=aspnetcore-6.0&tabs=visual-studio

CodePudding user response:

You can use meta tag on the page header.

<meta http-equiv="refresh" content="5;url=/Book/AddNewBook" />

In Above Example Book is Controller Name and AddNewBook its Action Method Name.

Simply You can Return to the Same Page Using Above Controller and Action Method with New Updated Status.

OR

<meta http-equiv="refresh" content="5;url=https://www.google.com/" />

You can use Redirect to Other URL using Same meta tag.

  • Related