我有一个 Kendo ComboBox.in mvc4。并将其绑定到数据库。
我的代码:
@Html.Kendo().DropDownList().Name("id_team").BindTo(Model.tbl_team.Select(c=>new SelectListItem{Text = c.team, Value = c.id.ToString()}));
但下面的鳕鱼显示在我的组合框中:
Select Team:
<input data-val="true" data-val-number="The field id_team must be a number." id="id_team" name="id_team" type="text"/> <script> jQuery(function(){jQuery("#id_team").kendoDropDownList({"dataSource":[{"Text":"Barcelona","Value":"1"},{"Text":"manchester united","Value":"2"}],"dataTextField":"Text","dataValueField":"Value"});});
为什么?