コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         TipoTelefonoDropDownList.DataSource = Enum.GetValues(typeof(TiposTelefonos));
         TipoTelefonoDropDownList.DataBind();
     }
 }
コード例 #2
0
        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");
        }