<select name="BasicInfo.Month">
<option value="na">Month</option>
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
I have this code which I copied from somewhere, I need to create a dropdown list MVC style, so I can mark the selected one etc. how can I convert this to something that MVC uses?
In it’s simplest form:
If you really want to, you can automate the list creation using the DateTime object. That way you also get culture specific month names.
Your model would be: