4
I need to know if an HTML element already exists, in my loop, if it exists I use it, if it doesn’t exist I create a.
How would you do it inside a
@foreach (var item in Model){ ... }
Following the comment of the Gypsy, as it is not possible I wanted a logic like this:
- I have a
List<String>
alphabetically ordered. - All strings starting with
A
I want you to stay below a<li>A</li>
I want a <ul>
with the <li>
s organized that way. Someone has some hint?
I need it dynamic because it’s always changing values.
Razor does not evaluate HTML elements: only elements within MVC. I think it is impossible to do what you want.
– Leonel Sanches da Silva
So as it is not possible I edited the question by putting another possible solution. Thank you.
– Ricardo
Much better. Now I can answer.
– Leonel Sanches da Silva