locked
Sys.WebForms.PageRequestManagerParserErrorException: issue in .NET framework 4.5.2 RRS feed

  • Question

  • User-1043510023 posted

    Hello Team,

    Throughout the application we are getting below error.On button click event, drop down selected index change event , check box changed event, text changed event , radio button checked change event(especially during post back of the page).

    Error Msg: "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 class to Response.Write(),response filters,HttpModules, or server trace is enabled. Details : Error parsing near 'ect the following:"|e_ButtonImg" src="Im"."

    We are using AjaxtoolKit 4.0 version. I suspect that this is causing related to update panel's partial rendering issue in IE9. 

    Note : i tried with below code inside page load  event my issue resolved  and it's working fine. Like wise i need to do for all server side changed event. instead of that is it possible to provide fix in web.config file ?

    Code fix :

    ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);

    scriptManager.RegisterPostBackControl(this.btnSave);

    Like wise i have to add code for all pages for remaining asp.net server controls. Could you please provide high priority on this issue and help us to resolve this issue in a generic way.

    Thanks much.

    Sara.

    Thursday, July 28, 2016 9:48 PM

Answers

  • User-1043510023 posted

    Hi Angie,

    RootCause:

    I have resolved the issue myself.while upgrading from VS2010 (.NET 4.0) to VS2015 (.NET 4.5.2). We have Enable browser link option is newly implemented in Visual studio 2013 and VS2015 . IDE.Since it's not implemented in VS2012 thats why my app was worked in VS2012.


    Problem: Enable browser link option is used to test the cross browser support(don't use this option unnecessaily) to verify the app design and f12 purpose to change and verify the UI in VS2013 and VS2015. But it impacted my async calls to "Its unnecessarily making multiple additional calls to server and modifying my actual Async reuest and respone". Also, it's impacted my custom framework as well. Note: enable browser link is registering json data along with small piece of js code in markup code). I don't want this code in my dev environment.


    Fix: If we unselect "Enable browser Link " option from VS2013 and VS2015 my app is started working fine without any single line of code changes.

    Thanks.
    Regards,

    Sarathi..!!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 10, 2017 6:41 PM

All replies

  • User-166373564 posted

    Hi

    Error Msg: "Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be ...

    What's a PageRequestManagerParserErrorException?

    The UpdatePanel control uses asynchronous postbacks to control which parts of the page get rendered. It does this using a whole bunch of JavaScript on the client and a whole bunch of C# on the server. Asynchronous postbacks are exactly the same as regular postbacks except for one important thing: the rendering. Asynchronous postbacks go through the same life cycles events as regular pages (this is a question I get asked often). Only at the render phase do things get different. We capture the rendering of only the UpdatePanels that we care about and send it down to the client using a special format. In addition, we send out some other pieces of information, such as the page title, hidden form values, the form action URL, and lists of scripts.

    To troubleshoot it, see: Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it

    Regards,

    Angie

    Saturday, July 30, 2016 2:06 AM
  • User-1043510023 posted

    Hello Angie,

    Thanks for the reply. I understood the root cause. But, i have a question for you. Same update panel is working fine in .NET 4.0 framework in production. So far we are not facing this issue and rendering in IE9-compatibility mode.

    Recently we are migrating our app from .NET 4.0 to 4.5.2 framework using VS 2015 . Now only we are facing Error Msg: "Sys.WebForms.PageRequestManagerParserErrorException". Could you please provide more explanation on this ?.  In my very first post, i put that two lines of code in on page load event my issue was resolved. Even though,we have many controls inside update panel through out the application. Do i need to add code for remaining controls or is there any generic way of fix is available?

    Note: Is<asp:Updatepanel></asp:Updatepanel> issue is resolved in latest version of .NET framework?

    Thanks.

    Sara

    Saturday, July 30, 2016 7:24 AM
  • User-1043510023 posted

    Hi Team,

    We have .NET framework 4.0 web application and opened the solution into visual studio 2015. Build was successful and if we clicked on save button on very first of our application, we are getting below error message.

    Throughout the application we are getting below error.(especially during post back of the page).

    Error Msg: Sys.WebForms.PageRequestManagerParserErrorException: Themessage received from the server could not be parsed.Commoncauses for this error are when the response is modified by calss to Response.Write(),response filters,HttpModules, or server trace is enabled. Details : Error parsing near 'ect the following:"|e_ButtonImg" src="Im".

    We are migrating our application from .NET 4.0(VS2010) to 4.5.2(VS2015- recently  installed ). Although, we changed the target framework to 4.5.2 and build was successful, Application opened successfully in browser after clicking on save button we are getting same issue. Please guide  us how to resolve the above issue.

    Note : Regarding this issue i have posted in below link

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/feb35063-5923-4d9d-8c6a-57d59e6eb06c/visual-studio-2015-issue?forum=netfxbcl

    Thanks much.

    Sara

    Monday, August 1, 2016 8:45 PM
  • User61956409 posted

    Hi Sara,

    Firstly, I’d like to know if every web page has same issue. And what do you do on save button click event?

    Secondly, you could share us a sample that could reproduce the issue, and then we will reproduce the issue on our side.

    Best Regards,

    Fei Han

    Tuesday, August 2, 2016 8:29 AM
  • User-1043510023 posted

    Hi Fei,

    Thanks for the reply!. Throughout the application we are using <asp:UpdatePanel></asp:UpdatePanel>in *.aspx and *.ascx files. We are migrating our web app from .NET 4.0 (VS2010)framework  to 4.5.2 (VS2015).We just opened the existing 4.0 solution into VS2015 and executing our app and app was launched successfully.while clicking on save button (saving the data)page is getting postback that time we are getting below error.

    Error Msg: Sys.WebForms.PageRequestManagerParserErrorException: Themessage received from the server could not be parsed.Commoncauses for this error are when the response is modified by calss to Response.Write(),response filters,HttpModules, or server trace is enabled. Details : Error parsing near 'ect the following:"|e_ButtonImg" src="Im".

    Note: We have tried with target framework 4.5.2 in VS2015, eventhough we are getting same error. But, same code is working fine in prod (>NET 4.0). Can you please say why it's not working in .NET 4.5.2?

    Also, We are using Ajax toolkit version 4.1.0 in .NET 4.0, after getting this error we tried with latest version of ajaxtoolkit version 16.1 in VS2015 but no luck same error.

    And I search on web sites and find some similar threads as below for your reference.

    https://blogs.msdn.microsoft.com/carloc/2008/02/06/the-message-received-from-the-server-could-not-be-parsed/

    http://stackoverflow.com/questions/4950451/ajax-updatepanel-giving-error

    http://stackoverflow.com/questions/1554728/how-to-fix-error-the-message-received-from-the-server-could-not-be-parsed

    Also,We are doing "GZIP" compression in web.config file too.

    Based on above reference,I tried with below code in on -page load event and it was working fine in VS2010. Also, if i use this code my ajax-modalpop-up is not working

    ScriptManager scriptManager = new ScriptManager.GetCurrent(this.Page);

    scriptManager.RegisterPostBackControl(this.btnSave);

    But same code is not working in VS2015,so i changed code like this and it's working ,but it's crating another issue my ajax-modalpop-up is not working.

    var scriptManager = ScriptManager.GetCurrent(this.Page);

    scriptManager.RegisterPostBackControl(this.btnSave);

    As i done some research on this issue and found that inside updatepanel ,if i clcik on any UI controls (button,dropdown,checkbox,radio) and it's creating async postback and it's causing this issue!.

    Please provide a generic way of fix to resolve this issue or else we have to put the above code in through out all the *.aspx.cs,*.ascx.cs files.

    Tuesday, August 2, 2016 5:36 PM
  • User-1043510023 posted

    Hi Angie,

    RootCause:

    I have resolved the issue myself.while upgrading from VS2010 (.NET 4.0) to VS2015 (.NET 4.5.2). We have Enable browser link option is newly implemented in Visual studio 2013 and VS2015 . IDE.Since it's not implemented in VS2012 thats why my app was worked in VS2012.


    Problem: Enable browser link option is used to test the cross browser support(don't use this option unnecessaily) to verify the app design and f12 purpose to change and verify the UI in VS2013 and VS2015. But it impacted my async calls to "Its unnecessarily making multiple additional calls to server and modifying my actual Async reuest and respone". Also, it's impacted my custom framework as well. Note: enable browser link is registering json data along with small piece of js code in markup code). I don't want this code in my dev environment.


    Fix: If we unselect "Enable browser Link " option from VS2013 and VS2015 my app is started working fine without any single line of code changes.

    Thanks.
    Regards,

    Sarathi..!!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, January 10, 2017 6:41 PM