Ejemplo n.º 1
0
 protected void DropDownListmunicipio_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         DropDownListbarrio.Items.Clear();
         DropDownListbarrio.Items.Add(new ListItem("Seleccione", "Seleccione"));
         barr.muninicio_idmunicipio        = Validar.validarselected(DropDownListmunicipio.SelectedValue);
         DropDownListbarrio.DataSource     = Validar.Consulta(barr.ConsultarBarriosIdMunicipio(barr));
         DropDownListbarrio.DataTextField  = "barrios";
         DropDownListbarrio.DataValueField = "idbarrios";
         DropDownListbarrio.DataBind();
     }
     catch (Exception ex)
     {
         textError.InnerHtml = ex.Message;
         Alerta.CssClass     = "alert alert-error";
         Alerta.Visible      = true;
     }
 }
Ejemplo n.º 2
0
 private void cargarBarrios(string dat)
 {
     try
     {
         DropDownListbarrio.Items.Clear();
         DropDownListbarrio.Items.Add(new ListItem("Seleccione", "Seleccione"));
         barr.muninicio_idmunicipio        = dat;
         DropDownListbarrio.DataSource     = Validar.Consulta(barr.ConsultarBarriosIdMunicipio(barr));
         DropDownListbarrio.DataTextField  = "barrios";
         DropDownListbarrio.DataValueField = "idbarrios";
         DropDownListbarrio.DataBind();
     }
     catch (Exception ex)
     {
         textError.InnerHtml = ex.Message;
         Alerta.CssClass     = "alert alert-error";
         Alerta.Visible      = true;
     }
 }