I apologize if something like this has been answered before, I am fairly new to razor so I'm sure I am probably doing this completely wrong but I gave it my best shot and now I need help.
@{ var skills = Model.Children; foreach (var list in skills.Count() <= 3){ <ul class="skills"> @foreach(var item in list){ <li><span style="width:@{@item.percentage};">@item.Name</span></li> } </ul> } }
My Goal is for every 3rd child I want to create a new ul. Each ul will then have 3 li items underneath it. I've attempted .Count() and .Take(3) but I know I wasn't doing it correctly because I keep getting error loading macro engine script. I'm not sure if that was would even be the correct way to go about it.
foreach 3rd item in dynamic list create new ul
I apologize if something like this has been answered before, I am fairly new to razor so I'm sure I am probably doing this completely wrong but I gave it my best shot and now I need help.
My Goal is for every 3rd child I want to create a new ul. Each ul will then have 3 li items underneath it. I've attempted .Count() and .Take(3) but I know I wasn't doing it correctly because I keep getting error loading macro engine script. I'm not sure if that was would even be the correct way to go about it.
Thanks for any help in advance. I appreciate it.
-Blake
Hi Blake,
I think what you may be looking for is something like this
This is just from memory so you might need to check it
Thanks
Thank you so much!! that worked :)
No problem, glad I could help.
is working on a reply...