Hellraiser
Hellraiser

Reputation: 609

Asp.net MVC - Push a deferred client message from server

I have an intranet/extranet app which calls the server to do some VERY LONG calculations. The client should be able to keep surfing the site and doing his stuff, until a message pops up saying the calculation has ended and asking him if he wants to go back to the page to see the results.

If so, the client must be redirected to that page, the data must be retrieved the from the server and displayed. If the user cancels the action, the data set must be cleared.

How do I send a message to the client from C# and how do I catch it? Is it possible?

Thanks

Upvotes: 0

Views: 454

Answers (2)

Dave Swersky
Dave Swersky

Reputation: 34810

Reactive Extensions (Rx) for .NET deals with exactly this kind of problem. It allows for "push" notifications of remote events.

Here is a blog post that introduces Rx over ASP.NET:

http://weblogs.asp.net/podwysocki/archive/2010/02/16/introduction-to-the-reactive-extensions-to-javascript.aspx

Here's an entire RxJS library:

http://reactive-extensions.github.io/RxJS/

Upvotes: 1

YD1m
YD1m

Reputation: 5895

Yes, sending messages from server to client via http possible with using web-sockets or longpolling technologies.

Upvotes: 0

Related Questions