我无法让ddl填充.....我已经研究了大约3个小时。这是我的代码。我做错了什么
- name: format ZooKeeper HA state
command: /usr/bin/hdfs zkfc -formatZK -nonInteractive
become: yes
become_user: hdfs
run_once: yes
控制器:
@(Html.Kendo().DropDownListFor(m => m.Ethnicity)
.OptionLabel("--Select--")
.DataTextField("Description")
.DataValueField("Id")
.HtmlAttributes(new { style = "width: 100%; height:31px;" })
.DataSource(source => {
source.Read(read =>
{
read.Action("GetEthinicityValueSet", "HomeController").Type(HttpVerbs.Post);
}).ServerFiltering(false);
})
.Enable(true)
.AutoBind(true)
)
这将返回Quickwatch中的数据:
[HttpPost]
public List<DTOEthnicity> GetEthinicityValueSet()
{
ClientDB info = new ClientDB ();
return info.GetEthnicities();
}
答案 0 :(得分:1)
尝试以下:
public JsonResult GetEthinicityValueSet()
{
ClientDB info = new ClientDB ();
return Json(info.GetEthnicities(), JsonRequestBehavior.AllowGet);
}