RadAjaxLoadingPanel does not show up with custom user controls [Resolved]

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    16 posts
    Member since:
    Mar 2009

    Posted 27 May 2009 Link to this post

    I resolved this issue myself; Just in case anybody else runs into the same problem, I'll post it here...

    I created a user control and a RadAjaxManager for Ajax support.  The RadAjaxLoadingPanel was not showing up on Ajax operations.  So I decided to manually show/hide the loading panel by using RadAjaxManager.ClientEvents.  However, OnRequestStart and OnResponseEnd were not being triggered for some reason.  So I hooked into the Sys.WebForms.PageRequestManager instance and added a listener for beginRequest and endRequest.

    So I got that working and tried to show the RadAjaxLoadingPanel.  That's when I realized the problem.  RadAjax was trying to reference my user control client-side using ClientID.  However, I inherit from System.Web.UI.UserControl which does not have a wrapper containing the control ClientID.  So there was nothing to reference in the generated HTML.  After wrapping my user control in a div with its ClientID, RadAjaxManager.ClientEvents began to throw the OnRequestStart and OnResponseEnd events correctly, and the RadAjaxLoadingPanel worked without additional coding on the client-side.

    I don't know if this is the best way, but this is the code I used to resolve this issue:
        Public Overrides Sub RenderControl(ByVal writer As System.Web.UI.HtmlTextWriter) 
            writer.AddAttribute(HtmlTextWriterAttribute.Id, Me.ClientID) 
        End Sub 

    Hope this helps!
  2. Joe
    Joe avatar
    69 posts
    Member since:
    Dec 2007

    Posted 07 Nov 2009 Link to this post

    Thanks Kevin,
    Although my situation was a little different, and I couldn't get your solution to work, I thought I would post my scenario and solution here as well...

    I have a user control which contains a RadAjaxManager. Apparently client-side events, specifically OnRequestStart and OnResponseEnd, do not work in a user control with RadAjaxManager (As Kevin described).

    Since I only really needed to ajaxify one control the solution for me was simply to replace RadAjaxMananger with a RadAjaxPanel and it worked great.

Back to Top