I'm currently trying to bind a DropDownList in a custom editor template. I want to populate this DropDownList with a list of organizations from the organization table.
The custom editor template is bound to the Volunteer model. A volunteer may belong to an organization, but this is not required, and there is no relationship between the Volunteer and Organization tables.
When adding a new volunteer, I want to display a list of organizations. The name of the selected organization will be saved in the Organization field of the Volunteer table.
In the case of an edit, I want to display a list of organizations in the DropDownList, with the volunteer's organization selected (in the case where the volunteer belongs to an organization).
I've searched through a number of examples, but haven't been able to find something that would work for this scenario. Any advice on how to proceed would be very much appreciated.