第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

為什么DropDownListFor在提交后失去了多個(gè)選擇,而ListBoxFor卻沒有?

為什么DropDownListFor在提交后失去了多個(gè)選擇,而ListBoxFor卻沒有?

收到一只叮咚 2019-07-08 13:08:58
為什么DropDownListFor在提交后失去了多個(gè)選擇,而ListBoxFor卻沒有?我讀過許多關(guān)于使用MultiSelectList的文章,并且還沒有理解我的DropDownListFor到底出了什么問題。我有一個(gè)ListBoxFor,它具有相同的視圖、視圖模型和數(shù)據(jù),運(yùn)行良好。我想使用DropDownListFor,因?yàn)樗膐ptionLabel參數(shù)沒有ListBoxFor。當(dāng)首次加載視圖時(shí),DropDownListFor和ListBoxFor都會(huì)顯示多個(gè)選定項(xiàng)。單擊Submit按鈕時(shí),所選項(xiàng)集合將回發(fā)到Controller操作OK,視圖將被刷新,ListBoxFor仍然顯示兩個(gè)選定項(xiàng),但DropDownListFor僅顯示一個(gè)選定項(xiàng)。控制器操作是像這樣構(gòu)造MultiSelectList:vm.TasksFilterGroup.Assignees = new MultiSelectList(employees, "Id", "FullName", new string[]  { "51b6f06a-e04d-4f98-88ef-cd0cfa8a2757", "51b6f06a-e04d-4f98-88ef-cd0cfa8a2769" });視圖代碼如下所示:<div class="form-group">  <label>ListBoxFor</label>  @Html.ListBoxFor(m => m.TasksFilterGroup.SelectedAssignees, Model.TasksFilterGroup.Assignees, new { @class = "form-control", multiple = "multiple" })</div><div class="form-group">  <label>DropDownListFor</label>  @Html.DropDownListFor(m => m.TasksFilterGroup.SelectedAssignees, Model.TasksFilterGroup.Assignees, new { @class = "form-control", multiple = "multiple" })</div>為什么DropDownListFor在提交后失去了多個(gè)選擇,而ListBoxFor卻沒有?
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 224 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)