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

前端 未结 10 1593
余生分开走
余生分开走 2020-12-15 21:30

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, t

相关标签:
10条回答
  • 2020-12-15 22:03

    On your button click, redirect to another page that can stream any files that you might want to do this type of thing with. We use a document.aspx page in many of our sites and then pass a document id via querystring and stream the file from there.

    In your example, you're basically trying to change the headers for a page that's already been displayed which isn't allowed

    0 讨论(0)
  • 2020-12-15 22:08

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

    0 讨论(0)
  • 2020-12-15 22:08

    Set your button to cause full postback like this:

     <Triggers>
    <asp:PostBackTrigger ControlID="PrintButton" />
    </Triggers>
    
    0 讨论(0)
  • 2020-12-15 22:12

    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.

    0 讨论(0)
提交回复
热议问题