I have a control I'm developing for my sitefinity based site. The site is almost all AJAX controls (using RAD and homegrown controls) except for one control in which the code-behind creates a PDF for the user to download. Currently the code looks something like this:
| System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
| response.AddHeader("Content-Type", "binary/octet-stream");
| response.AddHeader("Content-Disposition", "attachment; filename=TransactionHistory.pdf; size=" + pdfBytes.Length.ToString());
is a byte.
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
Timestamp: Wed, 19 Aug 2009 18:32:09 UTC
Message: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near '%PDF-1.5
1 0 o'.
URI: <remove for brevity>
so, how can I have this postback handled outside of AJAX and done through a normal POST command or how can I get the resulting response handled correctly on the client side?