protected void GvAdmin_SelectedIndexChanged(object sender, EventArgs e) { try { //Session["envioslide"] = "editar"; GridViewRow row = GvAdmin.SelectedRow; string Id_admin = ""; HiddenField cod = default(HiddenField); cod = (HiddenField)row.FindControl("Id_Administrador"); Id_admin = cod.Value; ServicioCom21.ServicioCom21 _administrador = new ServicioCom21.ServicioCom21(); DataSet ds = _administrador.Com21_consulta_administrador_id(int.Parse(Id_admin)); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { //seteo todos los valores de la consulta especifica this.hfIdsadmin.Value = dr[0].ToString(); Session["hfIdsadmin"] = dr[0].ToString(); this.txtusuario.Text = dr[1].ToString(); this.txtnombres.Text = dr[3].ToString(); txtapellidos.Text = dr[4].ToString(); txtcorreo.Text = dr[5].ToString(); txttelefono.Text = dr[10].ToString(); img.ImageUrl = dr[9].ToString(); if (Convert.ToBoolean(dr[11].ToString()) == true) { cbactivar.Checked = true; } else { cbactivar.Checked = false; } } Span1.Visible = false; btnedit.Visible = true; btninsert.Visible = false; } } } catch (Exception Ex) { Console.WriteLine(Ex.Message); ScriptManager.RegisterStartupScript(upMantenimiento, upMantenimiento.GetType(), "click", "alert('Error Tecnico por favor espere unos minutos');", true); } }