有没有一种方法可以在razor c#中使用从下拉列表中选择的项目制作列表框?

因此,我有一个下拉列表值,当用户选择一个项目时,它将触发事件监听器。我想允许用户向列表中添加多个选择(我不想只允许多选,因为列表可能很长)

    <div id="selectProps">
     @Html.DropDownListFor(m => m.siteId,new SelectList(Model.listOfSites.Select(x => new
       {
           Value = x.SiteID,Text = x.SiteName
       }),"Value","Text")," ---Select a Property--- ",new { id = "ddlProperties",style = "max-width: 500px; width: 100%" })
    </div>

如何从此下拉菜单中将选择添加到新列表框中?

hzhz020261 回答:有没有一种方法可以在razor c#中使用从下拉列表中选择的项目制作列表框?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3142387.html

大家都在问