简体   繁体   中英

How can I handle a JSON result in JavaScript (on MVC)?

I'm using Ext in a MVC project. I wrote a controller, like the code below. How do I handle this JSON reult in my JavaScript used in my View page?

    public ActionResult Index() 
    {
        List<PriceList> newList = new List<PriceList>
        {
             new PriceList { Number = 1, Price = 24},
             new PriceList { Number = 2, Price = 25},
             new PriceList { Number = 3, Price = 20},
             new PriceList { Number = 4, Price = 18},
        };

        return Json(newList);
    }

You can use jQuery templates. An example is Introducing jQuery Templates 1: First Steps .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM