【问题标题】:what is the the equivalent of this code(c#) on vb? [closed]这个代码(c#)在vb上的等价物是什么? [关闭]
【发布时间】:2013-09-06 15:00:45
【问题描述】:

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

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

【问题讨论】:

    标签: c# asp.net vb.net razor


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 2011-06-03
        • 1970-01-01
        • 2013-04-07
        • 2021-06-15
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-01-26
        相关资源
        最近更新 更多