you need to add this line in both HttpGet and HttpPost Actions like this:
public Action Result Create()
{
ViewBag.DBInstances = new SelectList(LoadDBInstances(), "Connectionstring", "InstanceName");
return View();
}
[HttpPost]
public Action Result Create(YourModel model)
{
ViewBag.DBInstances = new SelectList(LoadDBInstances(), "Connectionstring", "InstanceName");
return View();
}
or
[HttpPost]
public Action Result Create(FormCollection form)
{
ViewBag.DBInstances = new SelectList(LoadDBInstances(), "Connectionstring", "InstanceName");
return View();
}
Because when you set value in ViewBag it is accessible in View of that action but when another action is called the ViewBag value is destroyed and you need to set in ViewBag again.