I've created model constains field like this
public Dictionary<int, string> Egg { get; set; }
and view to show combobox like this
@Html.DropDownListFor(m => m.Egg.Keys,
new SelectList(
Model.Egg,
"Key",
"Value"))
but I can't write a httppost method at controler class because every time I face this error
[InvalidCastException: Specified cast is not valid.] System.Web.Mvc.CollectionHelpers.ReplaceDictionaryImpl(IDictionary
2 dictionary, IEnumerable
1 newContents) +131
I am reffering this article: How to write a simple Html.DropDownListFor()?