protected void btnBuscar_Click(object sender, EventArgs e) { DataTable table = null; table = ConsultasEspecificas.EscritoPrejudicial(this.txtRut.Text); if ((table != null) && (table.Rows.Count > 0)) { this.domicilios.Items.Clear(); this.domicilios.DataTextField = "domicilio"; this.domicilios.DataValueField = "comuna"; this.domicilios.DataSource = table; this.domicilios.DataBind(); this.hiddeDeudor.Value = table.Rows[0]["rsocial"].ToString(); this.hiddenDireccion.Value = this.domicilios.SelectedItem.ToString(); this.hiddenComuna.Value = this.domicilios.SelectedValue.ToString(); this.CargaGrilla(this.txtRut.Text); } else { this.domicilios.Items.Clear(); this.domicilios.Items.Insert(0, "Seleccione"); this.Grilla.DataSource = null; this.Grilla.DataBind(); } }