January 20, 2007

Sys is undefined - AJAX 1.0 RC

Okay, I am frustrated. My project was working fine a few days ago and now I'm getting the dreaded Sys is undefined error. I've been trying to track it down with no luck.

A Google search shows that there are many people with this same issue. I've gone through my config file and everything looks correct.

I'll keep working on it and will post here as soon as anything comes up.


Update: A little farther...

Ok it seems as if my ScriptResource.axd file is being encoded! I'm using the Blowery HTTP Compression Module and after adding an exclusion for the mime type: application/x-javascript my WebResource.axd started coming back - it was coming up with a blank file before. However I keep getting the error Invalid character. I think its because ScriptResource.axd is encoded and not being decoded!

It's also telling me that the Type.RegisterNamespace function cannot be found (this function exists in ScriptResource.axd). I checked with Fiddler and ScriptResource.axd is being GZIP encoded. So I removed any reference to blowery and still no luck! You can view my posts on the ASP.NET Forum here for further detail, my user name is SuperGhost (the Batman logo).

You can check if your script is being encoded by opening up Fiddler and calling your ScriptResource.axd. Run your page first and get the source. The source will contain the correct path and querystring to the ScriptResource.axd file as well as the WebResource.axd file.

I'll post an update when this gets resolved!


Resolved: Finally

Ok found the problem a few days ago. The file was being encoded and the problem was that I had earlier uncommented a line in my web.config and then commented it back out again. Apparently the setting remained, not sure why. This is the line:

<scriptresourcehandler enablecompression="true" enablecaching="true">

You can see the enableCompression is set to true. So a simple change was all it needed. I uncommented the line and set compression to false:

<scriptresourcehandler enablecompression="false" enablecaching="true">

And that's it! Resolved! Also the Blowery HTTP Module was not affecting the script at all. I hope this helps anyone else having this issue!

kick it on DotNetKicks.com

11 comments:

Alex said...

errors for the lose!

ElRusO said...

I have a big problem. Im not able to get work with blowey and Ajax Asp.net. There's an asyncpostback, but no change in page. Im getting crazzy. I just want to change a label text, And doest work. Can you post an example on how to implement?

Saravanan said...

Nope :( this fix didn't solve this problem for me. I've IE7 and Vista running.

ElRusO said...

I found a solution!! :D ..Now blowery work smooth with Ajax asp.net, (Im testing it on Windows Vista and IE7)

Unknown said...

Did'nt work for me either....well I cant even implement your fix!

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.

I would be using anthem if I did not have to use AJAX 1.0!!!!

Femi said...

Thanks for the comments guys, I've searched high and low and not one solution has worked for me!

Unknown said...

this worked for me

^httpHandlers^
^remove verb="*" path="*.asmx"/^
^add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/^
^add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/^
^/httpHandlers^
^httpModules^
^add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/^
^/httpModules^

Unknown said...

Thanks for the post. I was scratching my head like any thing form the past 5 hr. It helped me a lot.

Proka said...

I did the changes, now I get a new error :(

jorge said...

للمزيد من الأخبار الرياضية آخر اخبار الدوري الإنجليزي والايطالي والاسباني
سوبر كورة
, نتائج مباريات بطل اوروبا نادي
برشلونة
, لترجمة المواضيع مترجم قوقل ترجمة فورية مجانية

vivek said...

Congratulations. We re amazed with the caliber of the data supplied. I expect that you continue with the fantastic work done.
mesquite tx locksmith
Plantation locksmiths
Concord locksmith
Locksmith RedwoodCity CA
Locksmith RedwoodCity CA
Locksmith RedwoodCity
Locksmith RedwoodCity CA
Locksmith RedwoodCity CA
Locksmith Arlington Hts IL
Locksmith Arlington Hts
Arlington Hts Locksmith
Locksmith Arlington Hts
Arlington Hts Locksmith
Locksmith Arlington Hts
Arlington Hts Locksmith
Locksmith Arlington Hts
Locksmith Arlington Hts
Locksmith Arlington Hts
Arlington Hts Locksmith
Arlington Hts Locksmith
Locksmith Arlington Hts
Locksmith Arlington Hts
Aventura FL locksmith
Hialeah FL Locksmith
locksmiths fort worth
fort worth locksmiths
Hialeah FL Locksmith
Hialeah FL Locksmith