RadAjaxManager Master /content page

6 posts, 0 answers
  1. p p
    p p avatar
    12 posts
    Member since:
    May 2010

    Posted 09 Aug 2010 Link to this post

    I have a master page with RadAjaxManager and a content page with RadAjaxManagerProxy.
    In the content page i try to make callback  request to server from client side like this:


    var m = $find("<%=RadAjaxManager.GetCurrent(Page).ClientID %>");
    m.ajaxRequest(eventArgs);

    but "m" is allways null!

    The script is placed inside of RadCodeBlock!
    If you have any idea please share with me!

  2. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 10 Aug 2010 Link to this post

    Hello,

    Could you ensure that the RadAjaxManager on the Master page is placed after a ScriptManager or RadScriptManager?

    Greetings,
    Pavel
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. p p
    p p avatar
    12 posts
    Member since:
    May 2010

    Posted 10 Aug 2010 Link to this post

    Yes, it's placed after  a RadScriptManager.
    Behind the code everything woks just fine:
    RadAjaxManager manager = RadAjaxManager.GetCurrent(Page);
    "manager" is valid and i don't have any problem.
    My problem appear in javascript code  on client side.




  4. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 10 Aug 2010 Link to this post

    Hello,

    I am attaching a sample which is accessing the RadAjaxManager's client-side object in a content page. Take a look at it and let me know what differs in your case.

    All the best,
    Pavel
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. p p
    p p avatar
    12 posts
    Member since:
    May 2010

    Posted 10 Aug 2010 Link to this post

    If script code is placed in aspx file work  fine, but placed in separate file *.js  the error remain.
    Any idea?

  6. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 12 Aug 2010 Link to this post

    Hi,

    In that case you need to store a variable with the RadAjaxManager's CleintID (say on the content page):
    Content.aspx
    <script type="text/javascript" language="javascript">
        var ajaxID = '<%=RadAjaxManager.GetCurrent(Page).ClientID %>'; //this variable will evaluate the ClientID
    </script>
    And then use it in your javascript file:
    external js file
    function getAjax()
    {
        alert($find(ajaxID));
    }

    Best wishes,
    Pavel
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top