Potential AJAX Question

  • Thread starter Thread starter Chris
  • Start date Start date
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?
 
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)
 
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.
 
Back
Top