i have following code : controller method:
public ActionResult Register(int? registrationTypeId)
{
IEnumerable
var accountTypes = new SelectList(accountTypes, "AccountTypeId", "AccountTypeName");
foreach(var item in accountList)
if (item.AccountTypeId == registrationTypeId)
item.Selected = true;
ViewBag.AccountTypes = accountTypes;
In view,
@Html.DropDownListFor(n => n.AccountType, (SelectList)ViewBag.AccountTypes)