This is a migrated thread and some comments may be shown as answers.

DropDownListFor crashing on submit

1 Answer 126 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Ashvinder
Top achievements
Rank 1
Ashvinder asked on 16 Jun 2014, 07:16 AM
I have defined a DropDownListFor in my view as follows:
@(Html.Kendo().DropDownListFor(m=>m.BusinessUnitId)
 .OptionLabel("Select item...")
 .BindTo(new SelectList(Model.BusinessUnitList, "Key", "Value"))
)
where BusinessUnitList is a Dictionary<string, string> of value BusinessUnitIds and their descriptions.
Everything looks good on the screen and I can select a value and see its value via jQuery using: $("#BusinessUnitId").val()
However, when I try to submit the form, I get the following error:
System.ArgumentNullException
"Value cannot be null. Parameter name: items"

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 18 Jun 2014, 07:17 AM
Hi Ashvinder,

I am afraid that the provided code snippet does not reveal what exactly is causing the error. Sharing live link, or ideally - a runnable sample project where the issue is reproduced would help us pinpoint the exact reason for this behavior and advise you further. 

Regards,
Alexander Popov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
DropDownList
Asked by
Ashvinder
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or