Potential AJAX Question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris

    Potential AJAX Question

    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?
  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: Potential AJAX Question

    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)


    "Chris" wrote:
    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?
    >

    Comment

    • Chris

      #3
      Re: Potential AJAX Question

      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.Upd ate() only.
      If I leave this code in, the updatepanel doesn't update until after
      the loop is finished.

      bruce barker wrote:
      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)
      >
      >
      "Chris" wrote:
      >
      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?

      Comment

      Working...