This is a migrated thread and some comments may be shown as answers.

RadAjaxManager Master /content page

5 Answers 151 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
p p
Top achievements
Rank 1
p p asked on 09 Aug 2010, 10:12 AM
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!

5 Answers, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 10 Aug 2010, 07:10 AM
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
0
p p
Top achievements
Rank 1
answered on 10 Aug 2010, 07:29 AM
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.




0
Pavel
Telerik team
answered on 10 Aug 2010, 09:20 AM
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
0
p p
Top achievements
Rank 1
answered on 10 Aug 2010, 11:58 AM
If script code is placed in aspx file work  fine, but placed in separate file *.js  the error remain.
Any idea?

0
Pavel
Telerik team
answered on 12 Aug 2010, 01:34 PM
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
Tags
Ajax
Asked by
p p
Top achievements
Rank 1
Answers by
Pavel
Telerik team
p p
Top achievements
Rank 1
Share this question
or