Errr, some catchy title.... RSS 2.0
 Friday, April 20, 2007

When you’ve used ASP.NET AJAX’s UpdatePanel you may have come across this error. Its typical message 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.

 

 

 

 

 

If you get this error, the first thing everyone does is to check whether they have any of the things they were not supposed to be doing:

  • Calling Response.Write()
  • Using response filters or HttpModules
  • Having Server Trace enabled.

 If you check those things and are positive that they are not the case, you’re lost. Well as it turns out, there’s a fourth hidden option:

 

Calling Server.Transfer method.

 

The thing is, when you call Server.Transfer, the server generates HTML for the next page and sends it directly to the client which was expecting some part of the page that was supposed to be returned via AJAX. This generates PageRequestManagerParserErrorException. So, you cannot use Server.Transfer method.

 

Well, actually you can, but it cannot be an asynchronous call.

So if the button is inside the UpdatePanel it will automatically use asynchronous calls. Luckily, there are two ways to force it to make a full postback.

  1. If the button is created statically, then simply register it a as a PostBackTrigger.
  2. If the button is created dynamically, call ScriptManager.RegisterPostBackControl with the necessary button.
Friday, April 20, 2007 1:36:07 PM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Ajax | ASP.NET AJAX
 Wednesday, January 24, 2007

This is certainly the news for the day. Finally v1.0 of ASP.NET AJAX (previously known as ATLAS) is released.

You can download it from here

Also, check this calendar control. This is the coolest thing ever:

Note: This control is not part of core AJAX Framework. It is a part of ASP.NET AJAX Control Toolkit which is a collaboration project between MS and non MS coders on CodePlex.

Wednesday, January 24, 2007 11:29:56 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] -
Ajax
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2008
Marcin Waligora
Sign In
All Content © 2008, Marcin Waligora
DasBlog theme 'Business' created by Christoph De Baene (delarou)