Monday, March 26, 2012

PageRequestManagerParserErrorException when using a class with asynchronous calls

Hi all,

in the last days i come to a curious problem. On a page i use a GridView to show some data, and on select i show the details in a DetailsView. The Page inherits from a MasterPage and the controls inside an UpdatePanel. The GridView and the DetailsView are populated from different methodes of the same WebService. The WebService is in the same project and a class in App_WebReferences is generated also for testing the WebService function. There are no JavaScriptCalls to the WebService, all is pour C# in codebehind. Now to the problem. When initialice a proxy to the class in the webreference, all works fine and as axpected. But when i generate a class from the wsdl-file with wsdl.exe and use this proxyclass with asynchronous methods inside, the following error pops up:

"Sys.WebForms.PageRequestManagerParserErrorException: The Message received from the Server coul not be parsed. Common couses ..."

The curious is, the first pageload in browser is error free and the firts select also. But when i select a second time a row in the GridView the error pops up, whatever row i select. There is absolute no Response.Write in the hole project and tracing is diabled also.

I use the same struct on several pages in this project and that works. On some pages in this project i use asynchronous calls to WebMethods to populate controls in UpdatePanels without any problems.

Thanks for reading

Problem NOT solved in RC1.


I figured out, the problem comes from my CacheProfile. The WebMethod cache compete with the CacheProfile from the web.config. Simply changed thevaryByParam Attribute and all works like expected.

No comments:

Post a Comment