views:

221

answers:

4

Hi,

Not sure if I'll explain this properly but here goes. I having written an asp.net app using C# for the code behind. After the user makes some selection and hits the "run" button I pass off the processing to a dll written in C# but what I want is a way to periodically send information back to the client so they can see what's going on like how many records have been processed and things like that. How can I accomplish this?

thanks

+1  A: 

Have a look at Provide feedback to the user on Long Running Tasks – using loader image - MS AJAX and JQuery

Also: How Do I: Use the ASP.NET AJAX UpdateProgress Control?

Mitch Wheat
Neither of those solutions provide feedback from the server during the operation, do they? Aren't they just showing a loader image (such as an animated "in progress" graphic) to the client, while waiting for the server to respond?
RickNZ
it doesn't sound like this is the solution. It sounds like RickNZ says to just show that the server is processing but no feedback.
did you take a look at the second part of the article in the first link?
Mitch Wheat
A: 

There are many ways of accomplishing this kind of task. I am presenting a few ideas

Solution 1:

You can use Ajax Timer Control.

Solution 2:

Make a Windows Service that will read the information and will interact with the asp.net application to notify about the requested information. It will act as a background worker.

Hope this helps

priyanka.sarkar
A: 

This may have been my wording of the question but I found what I was looking for. You can use the HttpResponse.Flush method to achieve what I was trying to do.

A: 

This is often called HTTP Server Push or HTTP Streaming or Long Polling. Depending on how it's done.

You can also check out this SO question on HTTP Streaming...

http://stackoverflow.com/questions/1112413/cross-browser-implementation-of-http-streaming-push-ajax-pattern

Or this one with an example of Long Polling

http://stackoverflow.com/questions/333664/simple-long-polling-example-code

http://stackoverflow.com/questions/tagged/long-polling

kervin