find Rad ajax manager returns null

8 posts, 0 answers
  1. Gokul Gokul
    Gokul Gokul avatar
    17 posts
    Member since:
    May 2010

    Posted 28 Dec 2010 Link to this post

    Hi there,
                $find("RadAjaxManager1") returns null particularly when call from modal pop up button click. but while call from page controls events it works. Thanks in advance
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Dec 2010 Link to this post

    Hello Gokul,

    I am not quite sure about your scenario. In normal scenario your code will work fine. In complex scenarios like masterpage,user control, a better approach is to use the "ClientID" with server tag.

    Clientside:
    var ajax = $find('<%=AjaxMgr.ClientID%>');

    Please go through this documentation for more on RadAjaxManager Client object.

    Regards,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Gokul Gokul
    Gokul Gokul avatar
    17 posts
    Member since:
    May 2010

    Posted 29 Dec 2010 Link to this post

    Hi Shinu,
                 I found the problem and rectify it. the solution is rad ajax manager can only be found at updated controls event fires. the other control events which is not in updated controls list returns null while $find("RadAjaxManager1").

    Thanks for your reply...
  5. Dave
    Dave avatar
    36 posts
    Member since:
    Jan 2008

    Posted 06 Mar 2012 Link to this post

    Gokul,

    What was your solution to finding your RadAjaxManager instance using client-side code after being called from a modal pop up button click? I am running into the same problem you had. I use the $find method on the RadAjaxManager instance but it comes back null.

    Thanks,
    Dave
  6. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 09 Mar 2012 Link to this post

    Hello Dave,

    Based on your description is hard to determine what is causing the issue. You could try accessing the RadAjaxManager on the page by following the code shown below. Note that wrapping the JavaScript code in RadScriptBlock is required.
    <telerik:RadScriptBlock runat="server">
        <script type="text/javascript">
            var ajaxManager;
            function pageLoad()
            {
                ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");               
            }
        </script>
    </telerik:RadScriptBlock>

    Greetings,
    Antonio Stoilkov
    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.
  7. Lohith
    Lohith avatar
    7 posts
    Member since:
    Oct 2012

    Posted 08 Nov 2012 Link to this post

    I too was facing the issue. I had not OnclientClose method declare for windowsmanager but had not declared it. I was ignoring it. but other script that was trying to find the ctrl was also failing after that.  Though I did see the control in the DOM hierachy. 
  8. Daniel
    Daniel avatar
    192 posts
    Member since:
    Mar 2012

    Posted 03 Jan 2013 Link to this post

    I faced the same problem with Chrome and Firefox (works in IE).
    The $find("radAjaxManager") works sometimes for the first event, but returns null on subsequent events.
    The fix is to fallback to DOM if $find fails:

    <telerik:RadCodeBlock runat="server">
       var ajaxManager = $find("<%=radAjaxManager.ClientID%>");
       if(!ajaxManager) ajaxManager = window.<%=radAjaxManager.ClientID%>;
       ajaxManager.ajaxRequestWithTarget("<%=myControl.UniqueID %>", "");
    </telerik:RadCodeBlock>

  9. Vincy
    Vincy avatar
    10 posts
    Member since:
    Aug 2013

    Posted 08 Aug 2013 Link to this post

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