protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { TipoTelefonoDropDownList.DataSource = Enum.GetValues(typeof(TiposTelefonos)); TipoTelefonoDropDownList.DataBind(); } }
public void LlenarDropdownList() { TiposTelefono tipo = new TiposTelefono(); TipoTelefonoDropDownList.DataSource = tipo.Listado("Descripcion, TipoTelefonoId", "1=1", ""); TipoTelefonoDropDownList.DataTextField = "Descripcion"; TipoTelefonoDropDownList.DataValueField = "TipoTelefonoId"; TipoTelefonoDropDownList.DataBind(); TipoTelefonoDropDownList.Items.Insert(0, "Tipo de numero"); }