jQuery: How to traverse / Iterate over a list of object

前端 未结 3 1816
隐瞒了意图╮
隐瞒了意图╮ 2020-11-27 22:54

I\'m using asp.net MVC4 for web app development.

I would like to traverse a list of objects from a ViewModel.

Below is the class of the object:



        
3条回答
  •  半阙折子戏
    2020-11-27 23:40

    JavaScript generally is unhappy with razor components although if the above is part of an CSHTML file it will work.

    The other approaches are:

    1. Display the collection using razor @foreach ...
    2. Pass the collection as a parameter from you webpage into a JavaScript function on some event

    How are you calling this function and what does it do?

提交回复
热议问题