Results 1 to 2 of 2

Thread: Json return from Asp.Net WebApi

  1. #1

    Default Json return from Asp.Net WebApi

    Hi I installed the application tutorial Modern-Tunes and all works fine.

    When I call the ITunes service with

    proxy: {
            type: 'jsonp',
            url: '',
            reader: {
                type: 'json',
                rootProperty: 'feed.entry'
    and analize the response with chrome developers tools, I see this Response:{"feed":{"author":{"name":{"label" .......... etc etc })

    Here the call to ITunes service:

    All works fine (the grids present in Modern-Tune app are correctly populated).

    Now I tried to extend the Modern-Tunes application with a new call to my WebApi class with:

        proxy: {
            type: 'jsonp',
            url: 'https://localhost:44393/api/vinileobj',
            reader: {
                type: 'json'
    to call GET action on my running .Net application.

    And here the .Net controller:

        public class VinileObjController : ApiController {
            public List<Vinile> Get() {
                Vinile v1 = new Vinile();
                v1.Id = "1";
                v1.Title = "Attenti al lupo";
                v1.Artist = "Lucio Dalla";
                Vinile v2 = new Vinile();
                v2.Id = "2";
                v2.Title = "Cirano";
                v2.Artist = "Francesco Guccini";
                List<Vinile> listaVinili = new List<Vinile>();
                return listaVinili;
    Here the call: https://localhost:44393/api/vinileob...sonP.callback2

    The new call works fine but when I analyze the Response using chrome developers tools I see that:

    [{"Id":"1","Title":"Attenti al lupo","Artist":"Lucio Dalla"},{"Id":"2","Title":"Cirano","Artist":"Francesco Guccini"}]

    The Response does not contain the callback and I do not understand why!

    Can someone help me to understand the problem?


  2. #2
    Sencha Premium User
    Join Date
    Apr 2007
    Sydney, Australia

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts