Error when outputing PDF file using HTTP Response when using OnTheFlyPostBack

3 replies. Last post: March 22, 2010 4:13 AM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi,

 

I  am using custom "OnTheFlyPostBack" and on custom  post back I output a pdf file using "OnTheFlyPostBack" using the following piece of code

 

"

HttpResponse currentResponse = HttpContext.Current.Response;currentResponse.Clear();

currentResponse.ClearHeaders(); currentResponse.ClearContent();

HttpResponse currentResponse = HttpContext.Current.Response;currentResponse.Clear();

currentResponse.ClearHeaders(); currentResponse.ClearContent();

currentResponse.ClearHeaders(); currentResponse.ClearContent();

currentResponse.AppendHeader("Content-Disposition", "attachment; filename=" + fileName);

currentResponse.ContentType = mimeType;

currentResponse.BinaryWrite(results);

"Content-Disposition", "attachment; filename=" + fileName);

currentResponse.ContentType = mimeType;

currentResponse.BinaryWrite(results);

HttpContext.Current.ApplicationInstance.CompleteRequest();

 

The webgrid keeps on throwing an error and the code works fine when i do a full post back ? Is there a setting that I need to do in WebGrid to enable this behaviour ?

All times are GMT -5. The time now is 6:25 PM.
Previous Next