Sep 02, 2010 10:13 AM|manrippo|LINK
I was able to create a dropdownlist for my MVC project, but the value is not selected as selected value on the dropdownlist. It just shows whole county list from the first.The value is from database. I tried find it from previous post, but it was quite
confusing. Please, suggest me for any idea.
public ActionResult Edit(int i)
var items = new SelectList(db.MST_COUNTRies.ToList(), "COUNTRY_ID", "COUNTRY_NM");
ViewData["MST_COUNTRies"] = items;
<%= Html.DropDownList("COUNTRY_ID", (SelectList)ViewData["MST_COUNTRies"])%>