using $find method in DNN module

3 posts, 1 answers
  1. JC Wu
    JC Wu avatar
    15 posts
    Member since:
    Dec 2009

    Posted 28 Dec 2009 Link to this post

    I have a program that needs to call ajaxRequest from client side.
    When I use this code in any aspx page, it works fine.
    But when I put it into a DNN module,the $find method always return null.
    Is there any difference in DNN module?

    var ajaxManager = null;  
            function pageLoad() {  
                if (ajaxManager == null) {  
                    ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");  
            function SuccessHandler(privateToken, alias, message) {  
                var datetime = new Date();  
                ajaxManager.ajaxRequest("(" + datetime.toLocaleTimeString() + ")");  
  2. Answer
    Veli avatar
    2002 posts

    Posted 29 Dec 2009 Link to this post

    Hi JC Wu,

    Have you tried with:

    ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");

    In a DNN module, you may not (and should not) have RadAjaxManager placed in the module. It needs to go in a master page or an ASPX page if no master. Therefore, we use the static RadAjaxManager.GetCurrent() method to get a reference to the current instance of the manager.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. JC Wu
    JC Wu avatar
    15 posts
    Member since:
    Dec 2009

    Posted 29 Dec 2009 Link to this post

    Thanks for reply.
    I have tried
    ajaxManager = $find("<%=(this.Page.FindControl("RadAjaxManager1") as RadAjaxManager).ClientID%>"); 
    ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>"); 

    In first case, it gets null value when first time open the page.
    In second case,it works fine.
Back to Top