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


34 Responses to “Microsoft JScript runtime error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts.”  

  1. 1 Bikash

    Thanks it’s working.

  2. 2 Vreddy

    Thank you so much
    its working

  3. 3 Leandro of Brazil

    Thanks so much !!

  4. 4 Muhammad Amin

    Very good, it solved my problem

  5. 5 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

  6. 6 Dilip

    How to switch to the ToolkitScriptManager in AjaxControlToolkit.dll.

  7. 7 Dilip

    How to switch to the ToolkitScriptManager in AjaxControlToolkit.dll

  8. 8 Eli

    In my lenguage, Spanish, Excelente, Muchisimas Gracias

  9. 9 mj_developer

    Thank you. It’s working for me.

  10. 10 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.

  11. 11 dinesh kumar

    It’s working. Thanks

  12. 12 NC

    Thanks, it was exactly the solution i needed

  13. 13 Mattie

    Yes, working for me too… Thank You!

  14. 14 JMP

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

  15. 15 Chan

    thanx its working fine now,GR8

  16. 16 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.

  17. 17 Harshad

    That post is cool my problem ran awayyyyyyyyyyyyyyy.

    thans

  18. 18 asfarian

    Finally, a working solution.
    Thanks :D

  19. 19 Vennila

    It solved my Error… Thanks:)

  20. 20 seroxat

    i really like yours site

  21. 21 wolf

    How to switch to the ToolkitScriptManager in AjaxControlToolkit.dll.

  22. 22 shreyas

    Thank you. It worked for me.

  23. 23 Maarten

    Thanks that worked perfectly!

    Maarten

  24. 24 Justin

    Perfect! You do the internet great justice

  25. 25 Younus

    Thanks yaar.

  26. 26 Shweta

    Thanks a lot :) Its working!

  27. 27 Gusto

    Thanks so much. it works.

  28. 28 Ganesh

    It’s working thanks…

  29. 29 Dee

    Thanks so much, It’s working!

  30. 30 praveen

    Thank you it works for me

  31. 31 amir khammar

    tank you my problem resolve

  32. 32 Sek

    tks!!!!

  33. 33 Fran6

    This works, thanks a lot

  34. 34 Raja.N

    great, its working perfectly. tahnks

Leave a Reply