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

Request using AJAX to WEB API

1 Answer 97 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 2
Denis asked on 03 Dec 2012, 06:56 PM

I am trying to using the telerik library to do a http request to my web api which return a JSON.

I am not having any result neither and error.

This my code could somebody help me to see what I am missing.

Thank you in advance

    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />

   function GetApiRequest() {
                    alert(' Beging GetApiRequest');//TEST
                    var jsonResponse = null;
                        type: "GET", // HTTP method
                        url: 'http://localhost:3537/api/ipfiltervalues/1?displayFieldID=2', // URL
                        contentType: "application/json; charset=utf-8", //request the result to be in JSON
                        dataType: "json",
                        success: function (result) { //callback method to invoke when the request is complete
                            jsonResponse = result;
                        Error: function (x, y, z) {
                            alert(x + '\n' + u + '\n' + z);

                    alert('End GetApiRequest' + jsonResponse);//TEST

1 Answer, 1 is accepted

Sort by
Maria Ilieva
Telerik team
answered on 06 Dec 2012, 10:50 AM
Hi Denis,

Please review the answer provided in the support ticket you have opened for the same issue.
Also please avoid opening duplicate tickets for one problem so we could better track the case and provide proper solution.

Kind regards,
Maria Ilieva
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.
Asked by
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
Share this question