Here's an alternative that doesn't require any parsing or using a dropdown list index.
Create a list of month-to-month text, and then use it to create a dictionary to match text to value. Like this:
var months = from m in Enumerable.Range(1, 12) select new { Value = m, Text = (new DateTime(2011, m, 1)).ToString("MMMM"), }; var list = months.Select(m => m.Text).ToArray(); var map = months.ToDictionary(m => m.Text, m => m.Value);
Now the drop-down list can be populated from list , and any value that can be selected can be returned back to the value using map .
var month = map["January"];
This generates the text, but does not analyze it, so it should work for any culture.
source share