protected void btnRelatorio_Click(object sender, EventArgs e) { EventosBL eventosBL = new EventosBL(); Session["ldsRel"] = eventosBL.PesquisarDataset(txtEvento.Text, txtDataIni.Text, txtDataIniF.Text, txtDataFim.Text, txtDataFimF.Text).Tables[0]; if (((DataTable)Session["ldsRel"]).Rows.Count != 0) { //l//c ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "WinOpen('/Relatorios/RelCursos.aspx?Eventos=" + txtEvento.Text + "','',600,825);", true); } else { ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "alert('Sua pesquisa não retornou dados.');", true); } }
private void Pesquisar(string valor) { EventosBL eveBL = new EventosBL(); DataSet eventos; eventos = eveBL.PesquisarDataset(valor); Session["_dtbPesquisa_pesqEve"] = eventos; dtgEventos.DataSource = eventos; dtgEventos.DataBind(); }