简体   繁体   中英

Getting error - SCRIPT5022: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed

I need help. I have create one web application in .Net 3.5 which uses asp.net Master page, update panel and server controls. I have asp.net page which is created using Master page, it contains updte panel in it and update panel contains other server controls. I am trying to generate postback of link button, which is in Update panel, from javascript using

__doPostBack('<%= ServerControl.ClientID.Replace("_","$") %>', '');

Each browser is executing this code but IE7 is not executing this javascript. I am getting this error in IE7:

SCRIPT5022: 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 '

<!DOCTYPE html P'. 
ScriptResource.axd?d=83rNjjrfU8utKX3Fb9DiQ2ssFx4VjayT06ZNJ9Aj38iN2ufeWDf1Hd7nu73QshB8Q80tcmosFZ1IQcnqEvC-7nMUe8kLPGpreZP7iBWnviMAl8vzvxmED51yr720yzPv0&t=ffffffffec2d9970, line 513 character 13

I don't know what is causing here. I have tried to set this

ValidateRequest="false" EnableEventValidation="false"

but still it's not working. I have used Update panel because I want to send Asynchronous request to client, so i want to use Asynchrounous postback type event only I don't want to use PostBack type of events (which reloads whole page).

Please any one can help me in this? It will be really great help.

Thanks,

Anvesh

Most common reasons for that error:

  • Calls to Response.Write():
  • Response filters
  • HttpModules
  • Server trace is enabled
  • Calls to Server.Transfer()

Refer to this blog for more details on avoiding the error Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it

Ok I have solved this problem myself.

What I have done is I have set

ValidateRequest="false"

in page directive. Also I have remove action="#" from form tag.

I have changed this

<form id="Form1" method="post" action="#" runat="server">

to this:

<form id="Form1" method="post" runat="server">

I am writing reply over here so if any one is facing the same problem then he can use this solution.

Thanks, Anvesh

I had the same problem and I noticed that the error was being caused due to an error in an existing trigger in the table in which I was doing the insert.

Fixed the trigger and it worked

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM