How to fix error: The message received from the server could not be parsed

If you have the button inside updatepanel this maybe causing this, if don´t want to move it, just add a trigger for the button on the updatepanel, a postback trigger.


Set your button to cause full postback like this:

 <Triggers>
<asp:PostBackTrigger ControlID="PrintButton" />
</Triggers>

Keep your button outside the update panel. Then it works fine.


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.