Potential AJAX Question

C

Chris

I'm developing an ASP.NET Page that processes some files, does some
things to them. I'd like to have a gridview that displays each file,
and it's status, if it's done processing, still processing, etc. The
page runs for about a minute per file, so I was hoping I could use an
AJAX UpdatePanel control to refresh the gridview as a file is done
being processed. Is this doable?
 
B

bruce barker

yes and no. you can use the update panel to update the view, but there is no
way to notify the javascript when to do this. the sloppy way is to use the
ajax timer to refresh the grid every x number of seconds. a better way is to
use the timer to do a webservice call to test if the grid needs updating and
then do the refresh. the best is to use a polling webservice to get the
current status and use ajax to update the status in the grid without forcing
the browser to rerender the whole grid.


-- bruce (sqlwork.com)
 
C

Chris

How does this work with threading? I have a collection of threads
that are processing my files, and it seems like all page activity is
hung up here:

foreach (Thread thTemp in thBuilder)
{
thTemp.Join();
}

Until all the threads are finished. If I comment this out, the timer
solution you described works for the first UpdatePanel.Update() only.
If I leave this code in, the updatepanel doesn't update until after
the loop is finished.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top