protected void CargarComboEstados() { try { CatEstadosPaisBehaivor estadosItem = new CatEstadosPaisBehaivor(); estadosItem.Connection = ConectionBD; List <CatEstadosPaisDatos> estadosLst = estadosItem.CN_fn_EstadosPaisSel(1); cmbEstado.DataTextField = "estadoPais"; cmbEstado.DataValueField = "IdEstadoPais"; cmbEstado.DataSource = estadosLst; cmbEstado.DataBind(); cmbEstado.Items.Insert(0, "Seleccione un estado del país"); } catch (Exception ex) { throw ex; } }
protected void CargarEstadosPais() { try { CatEstadosPaisBehaivor estadospaisItem = new CatEstadosPaisBehaivor(); estadospaisItem.Connection = ConectionBD; List <CatEstadosPaisDatos> sectorLst = estadospaisItem.CN_fn_EstadosPaisSel(1); cmbEstadoPais.DataTextField = "estadoPais"; cmbEstadoPais.DataValueField = "IdEstadoPais"; cmbEstadoPais.DataSource = sectorLst; cmbEstadoPais.DataBind(); cmbEstadoPais.Items.Insert(0, new ListItem("Seleccione un estado", "0")); } catch (Exception ex) { mensajeErrorlbl.Visible = true; mensajeErrorlbl.ForeColor = System.Drawing.Color.Red; mensajeErrorlbl.Text = "!Error / Cargar Estados: " + ex.Message + "!"; } }