I have a class called Partner, that I need to Submit all the info from the View.
The Drop Down list needs to be filled by a dataset and on submit I want to fill SelectedHeardAboutText with the selected drop down item.
Here is my class:
public class Partner
{
public string Name { get; set; }
public string SelectedHeardAboutText { get; set; }
public IEnumerable<SelectListItem> HowDidYouHear { get; set; }
}
Here is my PartnerController:
public ActionResult Partner() {
var hear = db.HowDidYouHears.ToList();
var partner = new Partner();
ViewBag.Hear = hear;
return View(partner);
}
How would I go about creating my drop down on the view, my view model is bassed on the Partner class?