List (Of SelectListItem)이 있고이를 NativeName으로 .Text 및 두 글자 ISO 영역으로 채 웁니다. .Value로 이름 지정. (SelectListItem의) 새로운 목록으로 = GetRegionInfosForEuOnly() 희미한 dropDownCountryList (System.Globalization.RegionInfo의)ASP.NET MVC에서 DropDownList의 List (Of SelectListItem) 항목을 미리 선택하는 방법 VB.NET
희미한 countryList으로 IList의는
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
이 작동하지 않습니다.
어떤 아이디어?