This question is locked. New answers and comments are not allowed.
I'm using ASP.NET MVC 3 technology and Telerik combobox in my project.
Here is how I'm populating the data:
mod.LangPref = new SelectList(new[]{ new SelectListItem{ Text="English", Value="1"}, new SelectListItem{ Text="French", Value="2"}, new SelectListItem{ Text="German", Value="3"} }, "Value", "Text", "2"); and populate the control in the view as follows:
@( Html.Telerik().DropDownList() .Name("langpref") .BindTo(new SelectList(mod.LangPref, "Value", "Text")) .HtmlAttributes(new { style = "width:150px; text-align: left" }) )
But when I attempt to update model using the
TryUpdateModel(mod) function
I'm getting error message:
"No parameterless constructor defined for this object."
Could you tell me what's wrong?
Thanks.