Joined July 2013
·

Alan Roberto Pérez Hernández

Mexico City Area, Mexico
·
·
·

Posted to Convert Enum to MVC Html.DropDownList over 1 year ago

Yo siempre uso algo así:

/*****Controller*****/

var ValorParaPreAsignar = 2;

var CatalogoAMostrar=db.Tabla.where(x=> x.activo==true).ToList();

ViewBag.MiFuenteDeDatos = new SelectList(CatalogoAMostrar, "IdCatalogo", "Descripcion", ValorParaPreAsignar);

/*****Vista*****/

@Html.DropDownList("MiFuenteDeDatos")

Achievements
29 Karma
1,176 Total ProTip Views
Interests & Skills