Center RadAjaxLoadingPanel from RadAjaxManagerProxy in Dynamically Loaded User Control

2 posts, 0 answers
  1. Bob
    Bob avatar
    1 posts
    Member since:
    Apr 2012

    Posted 10 Feb 2013 Link to this post

    So...I have a page with a RadAjaxManager that is dynamacially loading a user contol. It display a RadAjaxLoadingPanel perfectly when loading the user control. Inside the User Control page (ascx) I have a RadAjaxManagerProxy defined. No matter what combo of settings I used in the proxy, I was not able to get the loading panel to display until I added the following to my Page_Load of my User Control.

    RadAjaxManager.GetCurrent(this.Page).AjaxSettings.AddAjaxSetting(ddAgent, panelTarget, RadAjaxLoadingPanel1);

    I've been able to work around this by adding each initiator control to the Page Load in the above fashioni. After adding this, the loading panel now displays from the User Control. The only issue is that it I can't seem to figure out how to center the Loading Panel in the center of the page.

    The base page utlizes the following javascript to center the control (not showing the code since it works and was borrowed from previous code):
    <ClientEvents OnRequestStart="centerLoadingPanel"></ClientEvents>

     Wondering how to get the same functionality on the RadAjaxManagerProxy which doesn't seem to support the ClientEvents..and not sure if the proxy is even being utilized any more.
  2. Angel Petrov
    Angel Petrov avatar
    1096 posts

    Posted 14 Feb 2013 Link to this post

    Hello Bob,

    You can center the loading panel on the base page in which the user control will be placed. Note that you can not directly center the panel inside the user control. However this is achievable but you will have to calculate the exact position in the base page where the loading panel should display. I suggest that you examine this help article which can give you an idea on how to perform the needed calculations.

    As for the client events, you can always obtain a reference to the RadAjaxManager by using:
    protected void Page_Load(object sender, EventArgs e)
        RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
        manager.ClientEvents.OnRequestStart = "onRequestStart";
    Please note that by doing so you are setting the client events of the RadAjaxManger in the base page. RadAjaxManagerProxy does not support client events.

    All the best,
    Angel Petrov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top