Sys.webforms.pagerequestmanagerparsererrorexception: unable to parse message received from server

chinese:

Sys.WebForms.PageRequestManagerParserErrorException:

The message received from the server cannot be parsed. The common reason for this error is that response filters, httpmodules, or server tracing will be enabled when the corresponding message is modified by calling response. Write().

Details: error parsing nearby output.

The solution is as follows:

1. If the server control calling the response. Write() method is on the page using the UpdatePanel, you only need to add a node under the UpdatePanel and register the control with postbacktrigger. The code is as follows:

    < asp:ScriptManager ID= “ScriptManager1” runat=“server”>& lt;/ asp:ScriptManager>& lt; asp:UpdatePanel ID= “UpdatePanel1” runat=“server”> & lt; asp:PostBackTrigger ControlID= “Button2” />

    < asp:Button ID= “Button2” runat=“server” OnClick=“Button2_ Click” Text=“Button” />& lt; asp:UpdateProgress ID= “UpdateProgress1” runat=“server”>& lt;/ asp:UpdateProgress> & lt;/ asp:UpdatePanel>

    2. However, if the UpdatePanel is used in the master page, the above methods cannot be used to solve the problem. Otherwise, the following error may appear:

    A control with ID ‘btnExport’ could not be found for the trigger in UpdatePanel ‘UpdatePanel1’.

    This is mainly because updatepanel1 cannot be found & lt; asp:PostBackTrigger ControlID= “btnExport” /> Because we generally do not add this control (btnexport) to the master page( Of course, if a control with ID btnexport is added under the node of the UpdatePanel, there will be no error.)

    If there is such an error, what should I do?My solution is to use the page of the control page where the response. Write() method is needed_ Add the following code to the load event:
    ((ScriptManager) master. Findcontrol (“scriptmanager1”)). Registerpostbackcontrol (btnexport)
    // scriptmanager1 is & lt; asp:ScriptManager ID= “ScriptManager1” runat=“server”> & lt;/ asp:ScriptManager> ID of

    Reprint address: http://www.cnblogs.com/shenyixin/archive/2012/03/08/2385376.html


Read More: