Hi
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">
<Scripts>
<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" />
</Scripts>
</telerik:RadScriptManager>
function GetApiRequest() {
alert(' Beging GetApiRequest');//TEST
var jsonResponse = null;
$telerik.$.ajax({
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
alert(result);
jsonResponse = result;
},
Error: function (x, y, z) {
alert(x + '\n' + u + '\n' + z);
}
});
alert('End GetApiRequest' + jsonResponse);//TEST
}
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">
<Scripts>
<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" />
</Scripts>
</telerik:RadScriptManager>
function GetApiRequest() {
alert(' Beging GetApiRequest');//TEST
var jsonResponse = null;
$telerik.$.ajax({
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
alert(result);
jsonResponse = result;
},
Error: function (x, y, z) {
alert(x + '\n' + u + '\n' + z);
}
});
alert('End GetApiRequest' + jsonResponse);//TEST
}