I have search for days to find and figure out a multi-directional dropdownlist answer to this question.
I have the following model
public class Person()
{
public int Id { get; set; }
public string Name { get; set; }
public Gender Gender { get; set; }
}
I have tried to make Gender as an enum, string, SelectListItem....(the list goes on!)
In my HTTPGET person razor view I want add a new Person, with a dropdown generated with a list of genders ( male, female....)
and when the user submits the form it would pass the Person to the HTTPPOST Person view with the updated Gender attached.
I don't mind what type Gender is, just as long as it can post between controller and view both ways.
kind regards