RadAjaxLoadingPanel on page load

I wrote an example that shows how to fire the RadAjaxLoadingPanel on a button press, this example shows how to fire it on page load

I think this will be more realistic for me, most of my use is just a page that shows a grid, so 'on load' seems better. 

Related Articles

... and you 'll find more on the Telerik ASPNET Menu

ASP.NET: 

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site1.Master" CodeBehind="Test.aspx.vb" Inherits="Express.Test" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="header" runat="server">
    <script type="text/javascript">
        function pageLoad(sender, eventArgs) {
            if (!eventArgs.get_isPartialLoad()) {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("InitialPageLoad");
            }
        }    
 
    </script>
</asp:Content>
 
 
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label runat="server" ID="lblError" CssClass="Error"></asp:Label>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
    <asp:Panel ID="Panel1" runat="server">
        Page header, static content<br /><br />
        <asp:label runat="server" ID="lblContent"></asp:label>
    </asp:Panel>
 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="50">
        Please Wait...
    </telerik:RadAjaxLoadingPanel>
 
 
</asp:Content>

Code behind:

Imports System
Imports System.Web.UI.WebControls
Imports Telerik.Web.UI
Public Class Test
    Inherits System.Web.UI.Page
 
    Private Sub RadAjaxManager1_AjaxRequest(sender As Object, e As AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
        If e.Argument = "InitialPageLoad" Then
            'simulate longer page load
            System.Threading.Thread.Sleep(2000)
 
            lblContent.Text = "Content arrived, result of a long running query"
        End If
    End Sub
End Class

 

 

 

 

 

 

 

 


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences