I have a dropdown list that populates from a users table, this populates correctly and then using the DropdownListFor I wish to bind it to the corresponding field in my model (using MVC). It returns all of the records inside the DropDownList and causes a Json error. Any ideas?
cshtml:
@Html.LabelFor(model => model.AccountAdminUserID, htmlAttributes: new { @class = "control-label" })
@(Html.Kendo().DropDownListFor(model => model.AccountAdminUserID)
.Name("AccManagersDropDownList")
.DataTextField("FullName")
.DataValueField("AdminUserID")
.HtmlAttributes(new { style = "width: 100%" })
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetAccManagers", "AccountManager");
})
.ServerFiltering(true);
})
.SelectedIndex(0)
)