I am using MVC with C #, I have a problem as I can fill a ComboBox with @ Html.DropDownList () using an enumeration from my controller, knowing that in my ComboBox it should be placed as value (number in the enumeration) and the text (name of the country in the list)
<div class="text-left col-md-6">
<label class="col-sm-12 control-label" for="email-03" style="font-weight: normal;padding-left: 0px;">País</label>
<div class="text-left col-md-4" style="padding-left: 0px;">
@Html.DropDownList("DDLPais", ViewBag.Pais as SelectList, new { @class = "form-control col-md-12" })
</div>
<br />
</div>
in the controller
public enum Pais
{
Mexico = 1,
EU = 2,
Inglaterra = 3
}
List<Pais> lstStatus = Enum.GetValues(typeof(Pais)).ToList();
ViewBag.Pais = lstStatus;