Recently in SharePoint 2010 I've been seeing this stupid 'Type' is undefined error loading the Microsoft Ajax Framework.

Now can anyone shed some light into what would cause this to start happening today but not yesterday? Ya we upgraded the env.

What can be done to fix this problem?

I would like to rant here about how f'n crappy the MS Ajax Framework is, but I really hope someone else has this problem and can provide a quick solution. Do we really need to copy MicrosoftAjax to the layouts folder and reference it in the page - because that causes a tremendous number of other issues? Yes, there is a script manager in the master page directly inside the form tag. Yes I'm registering a script link to "SP.js". What gives?

  • 1
    If you're in a ranting mode, this is not a site for you. However, if you can provide exactly how you deployed the MS Ajax Framework, we'll try to help. Can you provide the location of the JS files and how you're referencing it in master page/layouts/user controls.
    – Roman
    Apr 2, 2012 at 18:00
  • You should not copy the Microsoft.Ajax files to layout and you should not include it yourselves, the scriptmanager loads it for resources inside the dlls. What did you upgrade in the environment? Apr 2, 2012 at 18:07
  • I am including a ScriptManager in the master page which is supposed to register the AJAX framework.
    – thastark
    Apr 2, 2012 at 18:55
  • Per Jakobsen - I totally agree - hence my dilema
    – thastark
    Apr 2, 2012 at 18:56
  • BTW - I have verified this in three independent environments running SP version 14.0.6106.1000; Two SharePoint consulting firms, one major law firm in Canada; No upgrades were made to the Microsoft Ajax Framework. 1) Custom Application Pages based on v4.master do not load Microsoft Ajax; 2) Script Manager does not load MS Ajax out of master page; 3) ScriptLink "sp.js" does not load MS Ajax. To be 100% honest, I'm thinking there may be an issue with browsers decoding Gzip ... this has to be a common problem by now right?
    – thastark
    Apr 2, 2012 at 19:00

2 Answers 2


I had this error and found that it went away if I made sure to set the Defer property on the ScriptLink to "true".

<SharePoint:ScriptLink runat="server" Name="SP.js" Localizable="false" Defer="true" /> 

Whenever that property was false, it would throw the error you noted.

Note I suspect you could also fix the issue by setting the LoadScriptsBeforeUI property on the ScriptManager to true, but I'm not positive that's the case since I don't know where the scriptmanager injects it's references, and if they would necessary be before the references generated by the ScriptLink

  • Amen brother. I've used both of those for similar situations. But the problem here is actually the dependency file Microsoft Ajax. You know the one where MS goes OOP all over JavaScript.
    – thastark
    May 14, 2012 at 13:49

I installed an update to Chrome and it resolved this issue. I believe it was an issue with GZIP compression and NOT an issue with SharePoint. I can no longer reproduce the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.