• Sign In
 
  • MSDN Blogs
  • Microsoft Blog Images
  • More ...
Common Tasks
  • Blog Home
  • Email Blog Author
  • RSS for comments
  • RSS for posts
Search
  • Advanced search options...
Tags
  • .NET Framewor
  • .NET Framework
  • Ajax/Javascript
  • ASP.NET
  • CLR
  • Cool stuff
  • DataAccess
  • Debugging/Windbg
  • Hotfix/Service Pack
  • IDEVDataCollector
  • IIS
  • Internet Explorer
  • Italian techs
  • LogParser
  • OT
  • Personal
  • Productivity
  • Random
  • Scripting/ASP
  • Security
  • Technology
  • Tools
  • Troubleshooting
  • Vista/Longhorn
  • Visual Studio
Archives
Archives
  • November 2010 (1)
  • October 2010 (1)
  • July 2010 (2)
  • April 2010 (1)
  • March 2010 (2)
  • February 2010 (2)
  • January 2010 (1)
  • October 2009 (2)
  • September 2009 (2)
  • August 2009 (1)
  • July 2009 (5)
  • June 2009 (1)
  • May 2009 (1)
  • April 2009 (3)
  • March 2009 (3)
  • February 2009 (5)
  • January 2009 (3)
  • December 2008 (5)
  • November 2008 (3)
  • October 2008 (2)
  • September 2008 (3)
  • August 2008 (3)
  • July 2008 (3)
  • June 2008 (5)
  • May 2008 (4)
  • April 2008 (8)
  • March 2008 (4)
  • February 2008 (5)
  • January 2008 (2)
  • December 2007 (4)
  • November 2007 (6)
  • October 2007 (6)
  • September 2007 (8)
  • August 2007 (6)
  • July 2007 (7)
  • June 2007 (10)
  • May 2007 (9)
  • April 2007 (12)
  • March 2007 (8)
  • February 2007 (5)
  • January 2007 (3)
  • December 2006 (1)
  • November 2006 (4)
  • October 2006 (2)
  • September 2006 (9)
  • August 2006 (2)
  • July 2006 (1)

The message received from the server could not be parsed

MSDN Blogs > Never doubt thy debugger > The message received from the server could not be parsed

The message received from the server could not be parsed

Carlo Cardella
6 Feb 2008 9:21 AM
  • Comments 10

Again on the Ajax-compression subject (see here and here), here's another error I got recently:

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.

The customer was using the GZipStream class within an HttpModule to compress the ASP.NET output; everything was working except in pages where he was using some UpdatePanel controls, where he was getting error messages like the above. As you can guess if you've read my previous posts, with http compression the response stream was being truncated.

There are a couple of solutions available to this error: do not use the HttpModule and rely on IIS compression, or move the application to the .NET Framework 3.5.

  1. Remove the HttpModule from web.config
  2. Assure ScriptResource is not compressed: <scriptResourceHandler enableCompression="false" enableCaching="true" />
  3. Open the IIS Manager
  4. Right click on "Web Sites" folder > Properties
  5. Click the "Services" tab
  6. Check "Compress application files" and "Compress static files"
  7. Apply and confirm all dialogs
  8. Stop IIS
  9. Open a command prompt and go to C:\Inetpub\AdminScripts
  10. 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"
  11. 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.

 

Carlo

Quote of the day:
There are painters who transform the sun to a yellow spot, but there are others who with the help of their art and their intelligence, transform a yellow spot into the sun. - Pablo Picasso
  • 10 Comments
ASP.NET, Ajax/Javascript, Internet Explorer
Leave a Comment
  • Please add 2 and 6 and type the answer here:
  • Post
Comments
  • Raman
    22 Feb 2008 7:06 AM

    Good Article.

    I have same error but in SharePoint Site. I have a webpart which uses AJAX. It communicate to Webservices and some other dlls. The webpart works fine when we install Web Services and Other dlls in same server(MOSS Server). I have tested my application with 2,3,and 4 server and application works fine. But I following 4 server setup throw error.

    I have 4 server environment,

    I have intalled component in following way:

    Server 1 - All dlls and Web Services 1

    Server 2 - Web Services 2 and Database

    Server 3 - Domain Server and Exchange server

    Server 4 - MOSS and Webpart

    With only this specific distributed environment my webpart causes this error.

    I have tried your approach but still I am getting the error.

  • Carlo Cardella
    28 Feb 2008 1:43 PM

    Raman, do you have any firewall/proxy between your servers? Anything which might remove/alter the HTTP headers or the web request? Here is a nice post on this erro: http://blogs.telerik.com/HristoDeshev/Posts/07-06-24/Firewalls_breaking_ASP_NET_AJAX.aspx?ReturnURL=%2fblogs.aspx%3fYear%3d2007%26Month%3d6

    HTH

  • Lukos
    19 May 2008 10:43 AM

    Hi Carlo,

    Interesting post. This is a very common problem cause by several things but I haven't found an article yet that covers the whole issue in useful detail. I have the same problem with a page and have checked all the things that can cause the problem but it is not any of those. I pulled the text from Fiddle during the request and it certainly looks OK but it is hard to tell. Do you have any other advice?

  • Neal F
    26 Jun 2008 9:53 AM

    I got the same error, but it was only when I set "Display tracing information on individual pages".  As soon as I unchecked it, the problem went away.

    To uncheck it -

    Website -> ASP.NET configuration

    Application Tab, choose "Configure debugging and tracing", then deselect "Display tracing information on individual pages"

    Hope this helps...

  • Colin
    7 Oct 2008 4:34 AM

    Thanks for the post. I also got this error when using Ajax UpdatePanels. After some investigation, I found that the error was occuring due to me creating a Session variable on the Async postback. This, in turn, changed the Content Header which completely confused the Ajax UpdatePanel/Response.

    I simply created the Session variable when the page loaded, rather than when the postback occured, which solved the problem.

  • Never doubt thy debugger
    4 Dec 2008 10:29 AM

    Http compression with client-side scripting should be handled with care. The problem can have different

  • Never doubt thy debugger
    10 Feb 2009 3:59 PM

    Ajax is a flexible and powerful technology, but sometimes “ With great power comes great responsibility

  • aru
    12 Mar 2009 2:08 AM

    I am getting the above issue, when I opened in two browerser in different pcs. I applied ajax technique over grdview. when I select the combo box, based on the selection I am re-rendering the gridview. If i did like that I am getting the above error in other browser end.

    please help me if any one have idea. thanks.

  • William Ramirez
    28 Apr 2009 2:11 PM

    I have exactly the same problem with the gridview and the dropdownlist. This is the scenario: I change the index of the dropdown list and while the postback is happening i end the session (with the login status control) and use this code:

    -------------------------------------------------------

      Session.Item("sID") = Nothing

           Session.Abandon()

           Response.Cookies.Remove(FormsAuthentication.FormsCookieName)

           Session.RemoveAll()

           FormsAuthentication.SignOut()

           FormsAuthentication.RedirectToLoginPage()

    -------------------------------

    Any suggestion will be appreciated. Thanks.

  • chamila
    26 Apr 2011 3:06 AM

    this is worked for me properly.

    chamilaw.blogspot.com/.../syswebformspagerequestmanagerparsererro.html

Page 1 of 1 (10 items)
  • © 2012 Microsoft Corporation.
  • Terms of Use
  • Trademarks
  • Privacy Statement
  • Report Abuse
  • 5.6.402.223