Design a site like this with
Get started

There is no ViewData item of type ‘IEnumerable’ that has the key ‘DropDownList’.


In Controller

ViewData["DropDownList"] = clsChargesCollection.FillInstallments().Select(x => new SelectListItem { Text = x.Description, Value = x.ID.ToString() }).ToList();


ViewData[“name to be given”]=db.MethodName.Select(object => new SelectListItem{Text = object.columnName, Value = object.columnName.ToString()}.ToList();

In View:

Try to access the variable within the top of your View where titles are given

List <SelectListItem> MemIds = ViewData["DropDownlist"] as List<SelectListItem>;

Now, Where you created DropDown:

@Html.DropDownList("DropDownList", MemIds, "--Select Membership ID--")

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at

Up ↑

%d bloggers like this: