早上好,我正在 vb 上搜索与此代码(c#)等效的代码:
@Html.DropDownList("cityId", (IEnumerable<SelectListItem>)ViewBag.Cities, new { id = "cityId" })
在 VB.NET 中应该是这样的:
Html.DropDownList("cityId", DirectCast(ViewBag.Cities, IEnumerable(Of SelectListItem)), New With { Key.id = "cityId" })
Html.DropDownList("cityId", DirectCast(ViewBag.Cities, IEnumerable(Of SelectListItem)), New With { _
Key .id = "cityId" _
})