У меня есть список (Of SelectListItem), и я заполняю его NativeName как .Text и двухбуквенным именем региона ISO как .Value
Dim countryList As IList (Of System.Globalization.RegionInfo) = GetRegionInfosForEuOnly ()
Dim dropDownCountryList As New List (Of SelectListItem)
For i As Integer = 0 To countryList.Count - 1
dropDownCountryList.Add(New SelectListItem() With {.Text = countryList(i).NativeName, .Value = countryList(i).TwoLetterISORegionName})
Next
...
<td>
<%=Html.DropDownList(customerType & "CountryCode", dropDownCountryList)%>*
<%=Html.ValidationMessage(customerType & "CountryCode")%>
</td>
Теперь я хочу установить RegionInfo для Германии в качестве предварительно выбранного элемента в DropDownList.
Но
dropDownCountryList.Item(4).Selected = True
не работает.
Есть идеи?