display array of arrays in mvc
How do I display the foolowing in my view?
I am having a class as follows:
public class testArrays()
{ public list<int>ID{get;set;}
public int Total开发者_Python百科Account{get;set;}
public List<int> Account{get;set;}
}
public List<testArrays> test {get;set;}
How can I displat the values of test in my view? Part of my code is as follows:
foreach(var i in model.test)
{
foreach(var j in i)<-----stuck as from here
{
}
}
Same way you do any nested loop. Unless im missing something?
foreach(var i in model.test) // i is "testArrays"
{
foreach(var x in i.ID) // x is "int"
{
// ..
}
}
A better way would be to use custom display templates.
精彩评论