Hello,
I have an Editor Template in which only a DropDownList is present. I am trying to populate that DropDownList using an action on my controller. I have the following code:
My action looks like this:
What am I doing wrong? The DropDownList doesn't get filled and keeps loading forever.
I have an Editor Template in which only a DropDownList is present. I am trying to populate that DropDownList using an action on my controller. I have the following code:
@(Html.Kendo().DropDownListFor(m => m)
.DataSource(
datasource => datasource
.Read(r => r.Action("GetPossibleLines", "ProductionProgram"))
.ServerFiltering(true)
)
.DataTextField("Text")
.DataValueField("Value")
.HtmlAttributes(new { style = "width: 200px" }))
My action looks like this:
[HttpPost]
public
ActionResult GetPossibleLines()
{
var options =
new
List<SelectListItem>()
{
new
SelectListItem() { Text =
"LI50"
, Value =
"51"
}
};
return
Json(options);
}
What am I doing wrong? The DropDownList doesn't get filled and keeps loading forever.