title: Call .NET method asynchronously and bind to grid upon completion
body: <p>Container.RetrieveItems() calls a service which takes a while so I would like to call it asynchronously (after the items are retrieved they are set to the List property of the Container class). Upon completion of retrieving the items, I would like it to update a gridView which is inside an updatePanel (updatePanel Mode="Conditional" and ScriptManager EnablePartialRendering="true". UpdatePanel has no trigger items). </p>
  
  <p>I have set breakpoints and stepped through each step. The items are retrieved, grid is databound then it calls update. No exceptions are being thrown but the grid is not updating with the content. If I set the UpdatePanel to update using a trigger and Timer.OnTick event it works perfect, however I only need it to update after the items are retrieved so firing the manual UpdatePanel.Update() upon completion of the service call would be ideal. </p>
  
  <p>I have done quite a bit of searching, but all the answers are 'You forgot to call DataBind()'</p>
  
  <p>Is there anything I am missing? </p>
  
  <pre><code>    private void UpdateGrid()
      {
          grid.DataSource = Container.List;
          grid.DataBind();
          updatePanel.Update();
      }
  
      protected void Page_Load(object sender, EventArgs e)
      {
          var task = Task.Factory.StartNew(Container.RetrieveItems);
          task.ContinueWith((x) =&gt; UpdateGrid());
      }
  </code></pre>
  
  <p><strong>Update:</strong>
  I set up a simpler test to try to identify the issue. I created a label whose Text property would be updated upon completion of a method. When the page loaded, it called the method and when the method finished it called updatePanel.Update() but no change.</p>
  
  <p>Per Jaimes' advice, I then tried calling the manual update inside the postback of a Button_click and it did indeed update the label. So that is why my current setup is not working, although I'm still searching for the best way to update content on completion of an asynchronous task.</p>