开发者

json returning list<customers>

i'm returning List<Customer> as json result in my con开发者_如何学运维troller. in the client script i can see the customers fine being returned.

can i somehow use the forin loop? because when i try it says that var i is undefined.

for (var i in customers)
{
alert(i.CustomerName);
}


try:

for (var i in customers)
{
    alert(customers[i].CustomerName);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜