Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 572 Vote(s) - 3.53 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ASP.NET Ajax Error: Sys.WebForms.PageRequestManagerParserErrorException

#1
My website has been giving me intermittent errors when trying to perform *any* Ajax activities. The message I get is

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'.

So its obviously some sort of server timeout or the server's just returning back mangled garbage. This generally, unfortunately not always, happe
Reply

#2
I solved this exact same problem removing the `Content-Type:` form the `Custom HTTP Headers` section in the `HTTP Headers` tab in `IIS`. This was breaking the encoding of the page and somehow it affected Ajax in general.

The `Content-Type` I had configured in `IIS` was setting the encoding to `ISO-8859-1`.
Reply

#3
Probably there is an error occuring on post back. In this case, you can view the details about the error by adding a PostBackTrigger to your updatepanel and referencing the button which causes the problem:

<asp:updatepanel ID="updatepanel1" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="button1" />
</Triggers>
<ContentTemplate>

</ContentTemplate>
</asp:updatepanel>
Reply

#4
This may be a little hacky, but it solved the issue for me. I didn't have any of the common reasons for the error, so I just put in this band-aid in the page load:

if (Session.SessionID == "")
{
Page.Session.Add("SessionID", Session.SessionID);
}
Reply

#5
Problem: Sys.WebForms.PageRequestManagerParserErrorException will occur when redirecting your page, lets say button click inside UpdatePanel in aspxAjax.

SOlution:

1. Add a "GoTo" button in your aspx page where update panel is using and add it outside Update panel

2. In your code assign ur just registered userID to session variable , say `Session["UseridJustregistered"]=Id` from DB or UsernameField

3. `Respose.Redirect("regSucces.aspx?urlid='" + Session["UseridJustregistered"] + "'");`

4. Check if `Session["UseridJustregistered"]` is null or not

This is OLD Classic ASP way which can solve our problem , by the time Microsoft find a solution we can tackle it this way.
Reply

#6
I solved this same problem by removing mistakenly-nested UpdatePanels.
Reply

#7
I had this happen to me and none of the causes on the list in the answer applied. I didn't find the root of the problem until I disabled my AJAX altogether. Discovered that the code was saving an object to the ViewState that contained an unserializable object. I made the object serializable and it started working again.
Reply

#8
There is an excellent blog entry by Eilon Lipton. It contains of lot of tips on how to avoid this error:

**[Sys.WebForms.PageRequestManagerParserErrorException - what it is and how to avoid it][1]**

Read the comments too. There is a comment of somebody with the same problem: "**I solved it changing server idle time of my app pool on IIS**. It was only 5, so I incremented it and now works."


*"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."*

**Most common reasons for that error:**

1. Calls to Response.Write():
2. Response filters
3. HttpModules
4. Server trace is enabled
5. Calls to Server.Transfer()

[1]:

[To see links please register here]

Reply

#9
I finally solved my variant of this same problem. I was attempting to copy/move a selected value between 2 listboxes in a webform. In my case, I had to specifically call {listbox}.ClearSelection() prior performing the action the 2nd time around.

So obviously this problem/error message can occur for a multitude of reasons.

Reply

#10
Change of the app pool FROM INTEGRATED to asp.net classic solved the problem for me.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through