So I have a view typed with a collection like so:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IList<DTO.OrganizationDTO>>" %>
The OrganizationDTO looks like this:
public OrganizationDTO
{
int orgID { get; set; }
string orgName { get; set; }
}
I simply want to create a Drop Down List from the collection of OrganizationDTO's using an HTML helper but for the life of me I cant figure it out! Am I going about this the wrong way?
Should I be using a foreach loop to create the select box?
Try this:
I did a small example, with a model like yours:
and a Controller like:
and in the view: