ASP.NET MVC MultiSelectList with selected values not selecting properly

后端 未结 6 1145
猫巷女王i
猫巷女王i 2020-12-02 17:09

I know others have asked this question, but I\'m totally confused by this:

This displays the dropdown with no values selected:

<%= Html.DropDownLi         


        
6条回答
  •  暖寄归人
    2020-12-02 17:46

    You can go to the to the value of "items" with this

     _
        Function Edit(ByVal crm_cliente As crm_cliente, ByVal form As FormCollection) As ActionResult
            If ModelState.IsValid Then
                Dim items As String
                crm_cliente.usuario_modifico = "ejmorales"
                crm_cliente.fecha_modifico = Date.Now
                items = form("items")
    

    that will get you the selected items as a string separate with commas (,)

提交回复
热议问题