0
public partial class Team
{
public int TeamId { get; set; }
public string TeamName { get; set; }
public string TeamDescription { get; set; }
public virtual IList<Trials> Trials { get; set; }
}
試驗是anothetr CALSS
public partial class Trials
{
public int TrialID { get; set; }
public string Name { get; set; }
public int TrialTyp_RefID { get; set; }
public bool isChk { get; set; }
public virtual ICollection<Team> Team { get; set; }
}
在我看來,我AMN試圖將ListBoxFor與試驗結合inseide球隊
@model Trials.Classes.Team
<td colspan="2">
@Html.ListBoxFor(model=> model.Trials,
new SelectList(ViewBag.trials,"TrialID", "Name"),
new { @class = "chosen-select", data_placeholder = "Select Trials...", style = "width:500px;", tabindex = "4" }
)
</td>
我無法得到任何值在控制器中的試驗測量..它顯示爲空,但我從列表中選擇多個值方框
感謝斯蒂芬....再次感謝澄清,我們不能這樣做...我已經嘗試了你所建議的字符串數組,並能夠獲得字符串數組中的值..... BUt我想知道如何綁定它直接與試驗O在團隊類中的對象...再次感謝 – Khan 2014-10-03 08:23:09