passA partial-page update is initiated by a client request (an asynchronous postback) to the server. The server processes the request and returns a response to the client.
If the browser does not receive a response in a specified time, the Sys.WebForms.PageRequestManagerTimeoutException is raised. To change the interval that elapses before asynchronous postbacks time out, set the AsyncPostBackTimeout property of the ScriptManager control.
If an error occurs on the server while the request is being processed, an error response is returned to the browser and the Sys.WebForms.PageRequestManagerServerErrorException exception is raised. To customize error handling and to display more information about the server error, handle the AsyncPostBackError event and use the AsyncPostBackErrorMessage and AllowCustomErrorsRedirect properties. For an example of how to provide custom error handling during partial-page updates, see Customizing Error Handling for UpdatePanel Controls.
If the response to an asynchronous postback returns without an error but there is an error processing the response in the client, the Sys.WebForms.PageRequestManagerParserErrorException is raised. For information about how to handle this error condition, see ASP.NET AJAX Debugging and Tracing Overview.
How to avoid this problem:
1. Calls to Response.Write():
Place an <asp:Label> or similar control on your page and set its Text property. The added benefit is that your pages will be valid HTML. When using Response.Write() you typically end up with pages that contain invalid markup.
2. Response filters:
The fix might just be to not use the filter. They’re not used very often anyway. If possible, filter things at the control level and not at the response level.
3. HttpModules:
Same as response filters.
4. Server trace is enabled:
Use some other form of tracing, such as writing to a log file, the Windows event log, or a custom mechanism.
5. Calls to Server.Transfer():
I’m not really sure why people use Server.Transfer() at all. Perhaps it’s a legacy thing from Classic ASP. I’d suggest using Response.Redirect() with query string parameters or cross-page posting.
Another way to avoid the parse error is to do a regular postback instead of an asynchronous postback. For example, if you have a button that absolutely must do a Server.Transfer(), make it do regular postbacks. There are a number of ways of doing this:
1. The easiest is to simply place the button outside of any UpdatePanels. Unfortunately the layout of your page might not allow for this.
2. Add a PostBackTrigger to your UpdatePanel that points at the button. This works great if the button is declared statically through markup on the page.
3. Call ScriptManager.RegisterPostBackControl() and pass in the button in question. This is the best solution for controls that are added dynamically, such as those inside a repeating template.
Hope it will resolve this problem. You can add your comments here.
Regards,
Vijay Modi
This problem also occurs very specifically with update panels when setting session variables. The website thread I linked has a solution to this problem. The difference between the problem linked and problem here is the absence of the methods you listed being used with the same symptoms.
By: Jason on May 9, 2007
at 1:34 am
http://forums.asp.net/1701186/ShowThread.aspx#1701186
By: Jason on May 9, 2007
at 1:34 am
Hi,
I don’t know to wich categories this belongs but SmartNavigation=”true” seems to cause also a “Sys.WebForms.PageRequestManagerParserErrorException”.
Just some tip if you looking for hours just as I did
Grtz
By: Lawrence on May 22, 2007
at 1:15 pm
The new URL to the ASP.NET AJAX Website article about debugging and tracing :
http://ajax.asp.net/docs/overview/ASPNETAJAXDebuggingAndTracingOverview.aspx
By: Marsouin on June 21, 2007
at 1:44 pm
Check your firewall settings too!
Solution Posted On Telerik Blogs
By: Shaun Peet on June 26, 2007
at 2:34 pm
That is some nice information on how to avoid the error. However, sometimes, this error may be absolutely unavoidable. For example, suppose the case where an Ajax partial-post calls to a database and suppose the database is offline due to a reboot. In such a case, the modal popup will appear in IE to the enduser, who must dismiss it. Furthermore, such popups will stack, such as when the Ajax calls are frequent, such as in a chat application’s polling. My question is– what can be done to CATCH the error, avoid the modal message box stacking, and redirect to show a generic error page? Please advise. Thank you. — Mark Kamoski
By: Mark Kamoski on August 13, 2007
at 2:44 pm
I find i only get the error when i have dynamically generated the controls. If i hard code the controls into the aspx page, i don’t get it. If i dynamically generate the controls in the code page then i get the problem on the whole page. I don’t know the answer but maybe this helps.
By: Shane on April 4, 2008
at 10:52 pm
Can someone give me a tip for this problem?:
I have textbox with user login, button “OK” and updatePanel with label (error messages).
I change login, hit “OK”. Server checks, if changed login is available (must be unique).
– if no, error is shown /* { lblError.Visible=true; updPnlError.Update() } */ – THIS WORKS FINE
– if login is available, i save change and than I WANT TO REDIRECT TO ANOTHER PAGE – How can i do that?? (In (STUPID) IE7, Server.Transfer() and Response.Redirect() don’t work – both shows the PageRequestManagerParserErrorException)
Thx..
By: BlueG on August 19, 2008
at 12:09 pm
yeah i am also facing similar problem, when i click on submit button , it interacts with database… some time it works fine, some times it throws same exception with error code 425…, i really dont understand what to do, becoz thre is no problem in coding.. i ma so sure abt this becoz if there would have problem then every time it would have throw exception which is not happening, one solution i found that to set “enable event validation to false” but this may also cause security issue, hence can not implement this.. can any one give some solution on this pls?
By: nikeeta on October 20, 2008
at 1:26 pm
“I’m not really sure why people use Server.Transfer() at all.” Fail.
By: Steve on October 22, 2008
at 2:32 pm
I searched every where on internet and every blog got the same answer as above…..I don’t know who copied whom……But no one explained or gave example of how to avoid this error.
I don’t know whether someone can truely com up with some perfect solution.
Since this post is created on Apr 13 2007, so the author here copied it from somewhere else bcz I find many more post with the same suggestions….
Please, try work on the problem first and then giv ur suggestions.
By: Nick on January 8, 2009
at 3:40 pm
Why Server.Transfer() is so wrong?
By: marta on June 22, 2009
at 9:13 am