I need to know if an HTML element already exists, in my loop, if it exists I use it, if it does not exist I'll create one.
How would you do this within a
@foreach (var item in Model){ ... }
Following the comment of Gypsy, as it is not possible I wanted a logic like this:
- I have
List<String>
sorted alphabetically. - All strings that begin with
A
I want them to be below a<li>A</li>
I want a <ul>
with <li>
s organized in this way. Anyone have any tips?
I need this dynamic because it is always changing values.