Sha
Sha

Reputation: 2427

Upgrading from asp.net 3.5 to asp.net 4.0 causes javascript-error on some postbacks

I have recently begun upgrading an existing and working .net website from ASP.NET v3.5 to v4.0 and the strangest thing occur.

When submitting web forms I get a javascript error like:

Message: 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. Details: Error parsing near '�'. Line: 5 Char: 84093 Code: 0 URI: http://ajax.microsoft.com/ajax/4.0/1/MicrosoftAjax.js

Notice the strange characters near "Details: Error parsing near"? Using Firebug, I was able to get the entire response (in unicode) which looks like this:

������ì½I%&/mÊ{JõJ×àt¡$Ø@ìÁÍæìiG#)«*ÊeVe]f@Ìí¼÷Þ{ï½÷Þ{ï½÷º;N'÷ßÿ?\fdlöÎJÚÉ!ªÈ?~|?"væÇægöfÿþϬ²üU>+ê|ÚþÌÏüî{ç«:oºªÍï_Mûû7ùt]çã¬Y½ûÝï/ªYþ»ß5Ùe>ûÿ'��ÿÿ¿Þv5F���

This makes no sense at all, and I honestly don't know how to fix it. Now I have tried to set various things like controlRenderingCompatibilityVersion="3.5" in web.config, removing/adding

<meta http-equiv="content-type" content="text/html;charset=utf-8"/>

to the header, reinstalling asp.net using aspnet_regiis -i from the 4.0 framework directory, restarted IIS, turned off EnableCdn on the scriptmanager tag to use local script files instead of the hostet cdn, tried various browsers (IE8, FF3.6.13, Opera, Safari). No luck. Next option will probably be a big sledge hammer.

I am running Windows 7 Ultimate 64 bit, have tried with IIS 7.5 and builtin ASP.NET webserver of VS2010 - same problem in both IIS.

Can anybody suggest a solution (other than the sledge hammer)?

Upvotes: 1

Views: 1377

Answers (1)

smnbss
smnbss

Reputation: 1041

It could have something to do with some custom http modules you have that change the response content on the fly... may be something to merge css/js files...

It's hard to tell without having access to your code.

You might try to disable some custom modules if you have any

Upvotes: 1

Related Questions