ASP.NET: Fuente de datos de cuadro de lista y enlace de datos
Tengo un cuadro de lista vacío en la página .aspx
lstbx_confiredLevel1List
Estoy generando dos listas programáticamente
List<String> l1ListText = new List<string>(); //holds the text
List<String> l1ListValue = new List<string>();//holds the value linked to the text
Quiero cargarlstbx_confiredLevel1List
cuadro de lista en la página .aspx con los valores y el texto anteriores. Así que estoy haciendo lo siguiente:
lstbx_confiredLevel1List.DataSource = l1ListText;
lstbx_confiredLevel1List.DataTextField = l1ListText.ToString();
lstbx_confiredLevel1List.DataValueField = l1ListValue.ToString();
lstbx_confiredLevel1List.DataBind();
pero no carga ellstbx_confiredLevel1List
conl1ListText
yl1ListValue
.
¿Algunas ideas?