Microsoft JScript runtime error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts.

By | 2010-05-03

After including a control from the ASP.Net AjaxControlToolkit I got this error:

Microsoft JScript runtime error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.

I believe there are many other problems which can cause this symptom, but in my case, asΒ the error message says, the solution is that you need to include the “ToolkitScriptManager” rather than the standard “ScriptManager”

To add the ToolkitScriptManager, you first need to include the assembly namespace on your aspx page.

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="asp" %>

If you control is right on your main page, chances are you have already done this. Β But in my case the Ajax control was embedded in a user control, so I didn’t have it on the main page yet.

Then you can simply include the manager by changing the standard script manager

<asp:ScriptManager ID="scriptMaster" runat="server"></asp:ScriptManager>

to this:

<asp:ToolkitScriptManager ID="toolkitScriptMaster" runat="server">
</asp:ToolkitScriptManager>

Environment: Visual Studio 2008, ASP.Net 3.5

57 thoughts on “Microsoft JScript runtime error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts.

  1. wowNOThelpful

    So what do you do if you’re working within a content page, and your script manager is on the master? Now post something about the scriptmanagerproxy so we can move on to the issues that arise from that

    Reply
  2. Dilip

    How to switch to the ToolkitScriptManager in AjaxControlToolkit.dll

    Reply
  3. Eli

    In my lenguage, Spanish, Excelente, Muchisimas Gracias

    Reply
  4. Beazy

    I have been trying to fix this issue for many weeks. I stumbled on this solution and it worked. I cannot say thank you more. Im serious.

    Reply
  5. JMP

    you are amazing! Thank you very much for this! I finally got it!

    Reply
  6. Gaijintendo

    Thought I would share how I screwed this up:

    I tried making this change for a control, but I didn’t have the tagprefix as TagPrefix=”asp” I had =”act”. Problem was I was typing <asp: and autocompleting …ToolkitScriptManager when I should have been using <act:ToolkitScriptManager….

    Dumb but that fixed it.

    Reply
  7. Harshad

    That post is cool my problem ran awayyyyyyyyyyyyyyy.

    thans

    Reply
  8. wolf

    How to switch to the ToolkitScriptManager in AjaxControlToolkit.dll.

    Reply
  9. Gowtham

    Thank you so much , Its really working πŸ™‚

    Reply
  10. Theo

    Removing ScriptManager is not a valid option for us SharePoint users who do not want this change applied to every app, site, and web in the entire farm cause we modified the out of the box master page. There should be a better method of doing this for SharePoint 2010 (would have been nice if Microsoft had put the ScriptManager in a content place holder so we could override it on a page by page basis).

    Reply
  11. santosh menon

    my problem is solved, is toolkitscriptmanager replacement of scriptmanager in new version of ajax please explan πŸ™‚

    Reply
  12. Dhinagaran

    Dear Friend,

    It is working fine Thank you so much

    Reply
  13. Vishal Prajapati

    Its working…
    Thanks a lot πŸ™‚

    Reply
  14. shahid

    Thanks you dear . You the rain in the desert..

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *