RadAjaxLoadingPanel without RadAjaxManager

7 posts, 0 answers
  1. Daniel
    Daniel avatar
    34 posts
    Member since:
    Feb 2011

    Posted 14 Mar 2014 Link to this post

    I have a master page with many pages and usercontrols.

    I have made great use of RadAjaxManager & proxies on my pages and user controls, however, there are a few events in the master page itself.  Since we can only have a single RadAjaxManager on a given rendered page, I cannot place a RadAjaxManager on the master page or I will have to move up all the RadAjaxManager and the OnAjaxRequest events up as well, which is not doable.  Further, the OnAjaxRequest needs to be placed in the Manager and not the proxy, which further makes moving to a single manager on the master page not achievable.

    How can I leverage a RadAjaxLoadingPanel on the master page for it's events based on this scenario

    Thanks in advance 
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 19 Mar 2014 Link to this post

    Hello Daniel,

    Generally you could manually show and hide the RadAjaxLoadingPanel on specific events of the controls placed on the Master Page. See the help topic below:

    http://www.telerik.com/help/aspnet-ajax/ajax-show-hide-loadingpanel.html

    Also note that in MasterPage scenarios the best approach is to have the RadAjaxManager on the MasterPage and add programmatic settings on the other application pages as well as handle its client and server events on the Content Pages. See the help topic below for more information on this matter:

    http://www.telerik.com/help/aspnet-ajax/ajax-masterpage.html
    http://www.telerik.com/help/aspnet-ajax/ajax-add-ajaxsettings-programmatically.html
    http://www.telerik.com/help/aspnet-ajax/ajax-ajaxmanagerproxy.html

    Regards,
    Maria Ilieva
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Daniel
    Daniel avatar
    34 posts
    Member since:
    Feb 2011

    Posted 19 Mar 2014 in reply to Maria Ilieva Link to this post

    Hi Maria

    Thank you for the reply.  Unfortunately, I saw these articles.  This method requires a RadAjaxManager on the master page in order to configure the  <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="ResponseEnd" />.  I also understand your best approach of having the RadAjaxManager on the masterpage, but this is not possible.

    We have many nested usercontrols.  If we place the RadAjaxManager on the masterpage, then the OnAjaxRequest for all pages would have to live there as well.  This would be a speghetti feed to access controls on the children nested 2 and 3 deep for update.  (It would be great if the RadAjaxProxy could manage OnAjaxRequest -- future request).

    This unfortunately makes the solution you offer not feasible.  Is there any other way ?













  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 24 Mar 2014 Link to this post

    Hello Daniel,

    In order to provide the best solution for your specific case I would ask you to provide exact application hierarchy scheme as well as detailed explanation of what exactly need to be achieved.
    Therefore I could suggest best approach for your specific scenario.

    Regards,
    Maria Ilieva
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
  6. Daniel
    Daniel avatar
    34 posts
    Member since:
    Feb 2011

    Posted 31 Mar 2014 in reply to Maria Ilieva Link to this post

    Sorry for the delayed response.. life sometimes overwhelms...

    We have a masterpage that all pages inherit from.  From there, pages mostly have 1 (or more) user controls.  In a number of instances, user controls have user controls.

    Because we can only define the OnAjaxRequest at the AjaxManager Level, it is too combersome to place a single AjaxManager at the Master page level as there are over 250 pages and 300 user controls.  Managing all the updates from the MasterPage would be arduous at best (Unless there is a secret I am not aware of).

    So... We have a radcombobox on the masterpage.  This defines the context of the appllication (what provider account).  When this is updated, we have no way of eliciting a RadAjaxLoadingPanel to show the application is busy, since the RadAjaxManagers are in the pages.  So. users are not aware of the fact that the application is in the process of changing context.

    We need a way of showing a "busy" when the combobox onselectedindexchange is elicited.

    Hope this is clear, if not, I will take another stab at it.
  7. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 03 Apr 2014 Link to this post

    Hello Daniel,

    In order to divide the OnAjaxRequest logic in different pages you could place a RadAjaxManager on the page and in its OnAjaxRequest use reflection to call the Page an AjaxRequest method which you could optionally define as shown in the example below.
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        MethodInfo methodInfo = this.Page.GetType().GetMethod("AjaxRequest");
        if (methodInfo != null)
        {
            methodInfo.Invoke(this.Page, new object[] { sender, e });
        }
    }
    public partial class RadGridAggregate : System.Web.UI.Page
    {
        public void AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            // your custom code for ajax request
        }
    }

    Additionally, if you want to show a loading panel on RequestStart I would suggest the approach shown below. The idea is to fire a event to which you could subscribe and show a loading panel.
    • MasterPage JavaScript:
    window.ajaxRequestHandlers = [];
    function OnAjaxRequest(sender, args) {
        var handlers = window.ajaxRequestHandlers;
        for (var i = 0; i < handlers.length; i++) {
            handlers[i](sender, args);
        }
    }
    • Page or UserControl JavaScript:

    window.ajaxRequestHandlers.push(function (sender, args) {
        // show loading panel
    });


    Regards,
    Antonio Stoilkov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  8. Daniel
    Daniel avatar
    34 posts
    Member since:
    Feb 2011

    Posted 03 Apr 2014 Link to this post

    Thanks for the reply Antonio... 

    We've had to move on for now.  We will circle back to this in a bit, so it may be a week or so before I repost... 

    Cheers
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017