protected void Page_Load(object sender, EventArgs e) { usuario = (Usuario)Session["Usuario"]; if(!IsPostBack) { PrestamosServiceClient client = new PrestamosServiceClient(); Prestamo[] prestamo = client.ListarHistorial(usuario.IdCli.ToString()); if (prestamo == null || prestamo.Length == 0) { divPromo.InnerText = "Estimado Cliente, hasta la fecha Ud. no ha adquirido préstamos"; divPromo.Visible = true; } else { gvData.DataSource = prestamo; gvData.DataBind(); divPromo.Visible = false; } } }