I create a viewbag as below
Dictionary<string, long> actlist = new Dictionary<string, long>();
foreach()
{
//filling the dictionary
}
ViewBag.act_type = new SelectList(actlist, "Value", "Key");
In the view call the view bag as below
@Html.DropDownList("acttype", new SelectList(ViewBag.act_type, "Value","Key"))
It's giving an error as below
SelectList does not contain a property with the name 'Key'
What I am missing here?