protected void BtnExportar_Click(object sender, EventArgs e) { String mapPath = Server.MapPath("\\temp"); FiltraAnimais(); String filePath = animalController.ExportaArquivoCSV(animais, mapPath); Response.ContentType = "application/csv"; Response.AddHeader("content-disposition", "attachment; filename=output.csv"); Response.TransmitFile(@filePath); Response.End(); }