0

How can I consume CrossDomaine services from my code behind using jsonp data.

I did it with javascript and it works just fine.

    $.ajax({
    type: "POST",
    crossDomain: true,
    timeout: 10000,
    url: getUrl() + "ExecuteAction?callback=?",
    data: { action: "HelloWorld", args: 'test'},
    contentType: "application/json; charset=utf-8",
    dataType: "jsonp"
}).done(function (msg) {alert("success");}).fail(function () {alert("error");});

Thanks.

Nabila
  • 191
  • 4
  • 19
  • The previous question also is posted by @Nabila :), but this question is concentrating on the JSONP specifically and this might help you: http://stackoverflow.com/questions/758879/asp-net-mvc-returning-jsonp – Nagaraj Tantri Feb 11 '14 at 14:09
  • @LearningNeverStops there is noting related to jsonp other than his title. I think OP is misguided by the answer in his previous question. – L.B Feb 11 '14 at 14:15
  • @L.B correct, I concluded about JSONP by looking at the last comment in that question and the title of this question. So now the user is stuck with jsonp code behind. – Nagaraj Tantri Feb 11 '14 at 14:40
  • Thanks @LearningNeverStops I am in fact stuck with jsonp code behind – Nabila Feb 11 '14 at 17:04

0 Answers0