We have a Sharepoint solution that uses AJAX. The button that triggers this is inside an update panel.
One of the things that we do is generate a MS Word document, that is then opened on the client so that it can be printed.
The code that sends the document to the client looks like this:
void OpenFileInWord(byte[] data)
{
Response.Clear();
Response.AddHeader("Content-Type", "application/msword");
Response.BinaryWrite(data);
Response.Flush();
Response.End();
}
The error that we are getting is:
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 '<?mso-application pr'.
We could save the document in Sharepoint first, and then open it from Sharepoint, but we would prefer not to do this.
The action that causes this code to execute MUST be a postback event, and not an AJAX call.
This is due to the nature of the way AJAX requests are processed.