Updating ASP.NET Label Upon Completion of Task
<p>Ok, so I've done some searching, but I can't seem to find exactly what I'm looking for. I'm fairly new to ASP.NET, but not to C#. I had to create a page to handle a regular web services request in order to update a web store with data from a web-based accounting software service. The problem I have is that I need the page to load first, then run the update, otherwise the page times out and the update fails. The display page has only a few labels, and that's all I require on it as the page will refresh every so often and run the update. However, I need the update method to be able to put the results to the screen. I have no problem getting the update to run, just making sure the results are displayed. I have no buttons that are pressed, there are no forms used.</p>

<p>Here's my page code:</p>

<pre><code>&lt;asp:Content ID="Content1" runat="server" ContentPlaceHolderID="MainContent"&gt;
&lt;div class="pageHeader"&gt;
    &lt;div class="caption"&gt;
        &lt;h1&gt;&lt;asp:Localize ID="Caption" runat="server" Text="Update of Order Status From NetSuite Into AbleCommerce"&gt;&lt;/asp:Localize&gt;&lt;/h1&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
        &lt;asp:Label ID="Label0" runat="server"&gt;&lt;/asp:Label&gt;
        &lt;br /&gt;&lt;br /&gt;
        &lt;asp:Label ID="Label1" runat="server"&gt;&lt;/asp:Label&gt;
        &lt;br /&gt;&lt;br /&gt;
        &lt;asp:Label ID="Label2" runat="server"&gt;&lt;/asp:Label&gt;
        &lt;br /&gt;&lt;br /&gt;
        &lt;asp:Label ID="Label3" runat="server"&gt;&lt;/asp:Label&gt;
&lt;/div&gt;
&lt;/asp:Content&gt;
</code></pre>

<p><br />
<br />
And here is my back code:</p>

<pre><code>public partial class Template_Default : CommerceBuilder.Web.UI.AbleCommercePage
{
    private void PerformUpdate(object State)
    {
        Store _Store = StoreDataSource.Load(1);
        Token.Instance.InitStoreContext(_Store);
        String results = PontoonUpdate.soUpdate(); // method that performs the updates
        Label3.Text = "Update Completed. " + String.Format("{0:MM-dd-yyyy hh:mm:ss}", DateTime.Now + "\n\n" + results);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        Label0.Text = "Update start time: " + String.Format("{0:MM-dd-yyyy hh:mm:ss}", DateTime.Now);
        Label1.Text = "Order updates will begin.";
        Label2.Text = "Processing...";
        if(!Page.IsPostBack)
            System.Threading.ThreadPool.QueueUserWorkItem(PerformUpdate);
    }
}
</code></pre>

<p>I know I'm missing something, and I know it's due to my lack of experience with ASP.NET. If anyone has any pointers I'd be greatly appreciative.</p>

<hr>

<p>Ok, I found the answer to what I wanted to do. I was searching for something else and found this...</p>

<p><a href="http://www.simple-talk.com/dotnet/asp.net/implementing-waiting-pages-in-asp.net/" rel="nofollow">http://www.simple-talk.com/dotnet/asp.net/implementing-waiting-pages-in-asp.net/</a></p>
