I have a grid that uses the same template for editing and creating a new user record.
Everything works fine when editing but for some reason when creating a new user the lanuageId is not being returned when posting the data back.
All of the other fields are binding fine but no matter what the value selected in the dropdownlist the value 0 is being returned.
@(Html.Kendo().DropDownListFor(m => m.LanguageId)
.DataTextField("Name") //Specifies which property of the Product to be used by the dropdownlist as a text.
.DataValueField("Id") //Specifies which property of the Product to be used by the dropdownlist as a value.
.HtmlAttributes(new { @class = "form-control" })
.DataSource(source => source.Read(read => read.Action("GetLanguageValues", "Account")))
The form works perfectly fine when editing.
What am I doing wrong?
Everything works fine when editing but for some reason when creating a new user the lanuageId is not being returned when posting the data back.
All of the other fields are binding fine but no matter what the value selected in the dropdownlist the value 0 is being returned.
@(Html.Kendo().DropDownListFor(m => m.LanguageId)
.DataTextField("Name") //Specifies which property of the Product to be used by the dropdownlist as a text.
.DataValueField("Id") //Specifies which property of the Product to be used by the dropdownlist as a value.
.HtmlAttributes(new { @class = "form-control" })
.DataSource(source => source.Read(read => read.Action("GetLanguageValues", "Account")))
The form works perfectly fine when editing.
What am I doing wrong?