Hi,
A totally newbie question, I know :)
Are there any equal to Headerstart in loops in Razor?
Best regards
Kurt
Hi,
A totally newbie question, I know :)
Are there any equal to Headerstart in loops in Razor?
Best regards
Kurt
Hi Kurt.
Nope - they only exist in the html templates because there are no other way to see if there are items in the loop.
In Razor you can use C# syntax - including LINQ. So you can do something like this (not real code, but close :-)):
myLoop = GetLoop("Whatever") if(myLoop.any()){ <ul> foreach(loopitem in myLoop){ <li>loopitem.GetValue()</li> } </ul> }
Thanks, Nicolai.
I had a hunch :)
You must be logged in to post in the forum