-1

早上好,我正在 vb 上搜索与此代码(c#)等效的代码:

@Html.DropDownList("cityId", (IEnumerable<SelectListItem>)ViewBag.Cities, new { id = "cityId" })
4

2 回答 2

1

在 VB.NET 中应该是这样的:

Html.DropDownList("cityId", DirectCast(ViewBag.Cities, IEnumerable(Of SelectListItem)), New With { Key.id = "cityId" })
于 2013-09-03T11:36:13.933 回答
0

Html.DropDownList("cityId", DirectCast(ViewBag.Cities, IEnumerable(Of SelectListItem)), New With { _ Key .id = "cityId" _ })

于 2013-09-03T11:36:01.683 回答