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

[Solved] Ajax Manager and Javascript

4 Answers 200 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 14 May 2008, 10:26 AM
Hello,

I am writting an application that uses javascript to call an Ajax_Request through the ajax manager.  We used to do this by using -

window[

"<%= RadAjaxManager1.ClientID %>"].ajaxRequest(srcElement);

the srcElement being the argument we are sending (usually a string).

Unfortunately with the upgrade to the q1 08 this is no longer working and just coming back with a javascript error saying that RadAjaxManager1 is null or not an object.

i have also tried -

var AjaxMan = Document.GetElementByID("<%= RadAjaxManager1.ClientID %>");
AjaxMan.ajaxRequest(srcElement);

Is there a new way to call the ajax request in javascript??

4 Answers, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 14 May 2008, 10:38 AM
Hello Ian,

Yes, the new RadControls for ASP.NET AJAX are entirely based on the ASP.NET AJAX and use the newly exposed client-side API of the framework. Getting the client-side object of a control now requires you to use the $find() method. More info is available in our help documentation here.

Regards,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ian
Top achievements
Rank 1
answered on 14 May 2008, 11:20 AM

That didn't seem to work, my code now contains -

var

ajaxmanager = $find("<%= RadAjaxManager1.ClientID %>");
ajaxmanager.ajaxRequest(srcElement);

it is now saying -

'null' is null or not an object.

0
Accepted
Steve
Telerik team
answered on 14 May 2008, 11:44 AM
Hello Ian,

Find attached a sample page that works as expected and revise your code. Do let us know if further help is needed.

Best wishes,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Ian
Top achievements
Rank 1
answered on 14 May 2008, 11:52 AM
Cheers, that helped alot, I was missing the RadScriptBlock.

Ian
Tags
Ajax
Asked by
Ian
Top achievements
Rank 1
Answers by
Steve
Telerik team
Ian
Top achievements
Rank 1
Share this question
or