function CallHandler() { $.ajax({ url: "iss_report.ashx", contentType: "application/json; charset=utf-8", success: OnComplete, error: OnFail }); return false; } function OnComplete(result) { $.fileDownload(result); } function OnFail(result) { alert('Request failed'); }
public class iss_report : IHttpHandler { public iss_report() { } public void ProcessRequest (HttpContext context) { Workbook wb= new Workbook(); context.Response.SetCookie(new HttpCookie("fileDownload", "true") { Path = "/" }); context.Response.ContentType = "application/pdf"; invoicebook.Save(context.Response, "mybook.pdf", ContentDisposition.Attachment, new PdfSaveOptions()); } public bool IsReusable { get { return false; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)