I writing ASP.NET MVC web app.
I have webpage here is design of it
Here is DropdownListFor
Also I have model , here is code:
public class Companies
{
[Key]
public int CompanyID { get; set; }
[Display (Name = "Компания")]
public string CompanyName { get; set; }
}
I need to display CompanyName in DropDownList CompanyName 's is in table (over 10)
I try to do it like this
@Html.DropDownListFor(m => m.Company,
new SelectList(Enum.GetValues(typeof(Companie_s))),
"Select Company")
But this right when I have enum
and static values.
Like this
public class Companies
{
[Key]
public int CompanyID { get; set; }
[Display (Name = "Компания")]
public Companie_s CompanyName { get; set; }
public enum Companie_s
{
Ciklum,
Luxoft
}
}
How I need to write code in my case?
Thank's for help.