Tuesday, April 22, 2008

sys.WebForms.PageRequestManagerParserErrorException:

sys.WebForms.PageRequestManagerParserErrorException: The message receieved from server could not be parsed. Common causes for this error are when the response is modified by calls to Response filters, HttpModules, or server trace is enabled.

There are a couple of solutions available to this error:
Try to put yur Sumbit button out of the Update Panel.

do not use the HttpModule and rely on IIS compression, or move the application to the .NET Framework 3.5.
Remove the HttpModule from web.config
Assure ScriptResource is not compressed:
Open the IIS Manager
Right click on "Web Sites" folder > Properties
Click the "Services" tab
Check "Compress application files" and "Compress static files"
Apply and confirm all dialogs
Stop IIS
Open a command prompt and go to C:\Inetpub\AdminScripts
Run the following commands to add .js, .aspx and .axd to the compression list:
cscript adsutil.vbs set W3SVC/Filters/Compression/GZIP/HcFileExtensions "htm" "html" "txt" "js"
cscript adsutil.vbs set W3SVC/Filters/Compression/Deflate/HcFileExtensions "htm" "html" "txt" "js"
cscript adsutil.vbs set W3SVC/Filters/Compression/GZIP/HcScriptFileExtensions "asp" "dll" "exe" "aspx"
cscript adsutil.vbs set W3SVC/Filters/Compression/Deflate/HcScriptFileExtensions "asp" "dll" "exe" "aspx"
Restart IIS
You can also move the application to .NET Framework 3.5 instead, because the UpdatePanel control has been changed internally and now this problem should not happen anymore.

1 comment:

AK Sabin said...

Hey, no need of 3.5 and all. This error may also happen when you are working in a Normal Website Project ( Not an Ajax Enabled Website ).

If you are working in a (Non Ajax Enabled ) Website and using update panel with out knowing the fact that you are not working in an Ajax Enabled website, Update panels may work some points ( I dont know how, and its wonder). But the same block of code will throw some parser error at certain time too.

I was experiencing the same and had waisted more than three days to sort this out. Finally i could find the issue with the web.config. I had a comparison with the web.config of other website project which was build in Ajax. ( Update panels and all were working fine there. )
Was shocked knowing that i was working in a non Ajax Website Project ! :))

Included the required tags for Ajax in the Web.config, started working cool.

Have a comparison between the Web.Config of Both Ajax and Non-Ajax website Projects.