How to set the selected index property for a SelectList with strings? (ASP.NET MVC)
- by Alex
I have the following code:
// Form the continuities list
string[] continuities = new string[] { "10s", "20s", "30s" };
Model.Continuities = new SelectList(continuities, 2 );
I expect "20s" to be selected
How can I do that without creating a new class?