Skip to content

Instantly share code, notes, and snippets.

@jonathanread
Created April 10, 2014 13:22
Show Gist options
  • Save jonathanread/47739331e7f29bea0d7a to your computer and use it in GitHub Desktop.
Save jonathanread/47739331e7f29bea0d7a to your computer and use it in GitHub Desktop.
CountryElement country = Config.Get<LocationsConfig>().Countries.Values.FirstOrDefault(c => c.IsoCode == countryCode.ToUpper());
List<SelectListItem> statesList = new List<SelectListItem>();
if (country != null)
{
foreach (StateProvinceElement state in country.StatesProvinces)
{
statesList.Add(new SelectListItem()
{
Text = state.Name,
Value = state.Abbreviation
});
}
}
dontShowPageData = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment