I have an enumeration in my Data layer and I want to use its drop down list in my website project. My enum in Data layer is:
namespace SME.DAL.Entities.Enums
{
public enum EntityState
{
Open,
Freezed,
Canceled,
Completed,
Terminated,
ReadOnly
}
}
How can I make its select list and use it in my website's page? I'm using ASP.NET MVC 4.
SelectList
in your Action and pass it to the view or create a custom Html helper to do that or create a template forEnum
in which you dynamically create the dropdown. The links posted in the answers bellow provide all the information needed to accomplish each of your options. – Kerman