Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Trigger UpdatePanel on page load

$
0
0

I have a massive, nasty grid that takes like 2 minutes to load.

I want to use an updatepanel and updateprogress to let the user know we are processing his request.

I don't want to respond to a button click.  I want the "spinner" to come up by itself, and go away when the data is loaded.

This means that the update progress is seen whenever the page data is loading, triggered by page_load, or page_init or something.

This is my page.

<!-- Required ScriptManager to handle the loading progress --><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager><!-- Your UpdateProgress Control --><asp:UpdateProgress ID="prgLoadingStatus" runat="server" DynamicLayout="true"><ProgressTemplate>
            Please wait...</ProgressTemplate></asp:UpdateProgress><asp:Label ID="Label1" runat="server" Text="Label" OnInit="Label1_Init"></asp:Label>


This is my Codebehind.

    protected void Label1_Init(object sender, EventArgs e)
    {
        Thread.Sleep(20000);
        Label1.Text = "This too shall pass.";
    }

What I am seeing is the updateprogress is never shown, it just waits 20 seconds and shows the end result.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>