As you can see here and here I am not a good friend of asp.net MVC SelectList.
This time I wonder how to count the elements in it. I want to show a shortcut instead of a drop-down list if the possible elements do not offer any choice (items.count <2).
- EDIT -
Although the answer probably works too, the easy way to go is a challenge
.GetListItems().Count()
This disables any lazy selections you have, but since they will still be in the drop down list, I don't think this should be a problem.
asp.net-mvc
Boris Callens
source share