Ok, so I want to display a list containing lists of lists of lists ...
I have no way of knowing how many levels to display, so I decided that this is where I exit the old recursive procedure.
I am having problems with how to do this, though.
This is what I have so far (apparently simplified):
@foreach(MyObject item in @Model.ListOfObjects){ <div> @item.Title </div> //Call recursive function? }
Now each of these objects also has a List <MyObject>. I want to display each level below this div, for example, indented tabs per level.
I thought the Razor function would be here, but I need help in building it. Here is my thinking:
@functions{ public static void ShowSubItems(MyObject _object){ if(_object.ListOfObjects.Count>0){ foreach(MyObject subItem in _object.listOfObjects){
But, as you can see, I clearly need help :)
c # asp.net-mvc asp.net-mvc-3 razor
Dynde Jun 21 '11 at 9:10 2011-06-21 09:10
source share