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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…