8

Can anyone have a solution for this issue

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 am using asp.net 3.5, VS 2008. The version i can see in the AjaxControlToolKit.dll file 3.5.40412.2.

saknet
  • 377
  • 3
  • 5
  • 14

9 Answers9

11

Try this:

Change

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

to

<ajaxToolkit:ToolkitScriptManager ID="toolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager> 
Palanikumar
  • 6,940
  • 4
  • 40
  • 51
10

Check if this link helps you resolve your issue -

http://blog.thinkoriginally.com/2010/05/03/microsoft-jscript-runtime-error-ajaxcontroltoolkit-requires-asp-net-ajax-4-0-scripts/

EDIT: Check this link for dll load error resolution -

http://geekswithblogs.net/LessonsLearned/archive/2008/08/21/hidden-surprises-in-.net-3.5-service-pack-1.aspx

Sachin Shanbhag
  • 54,530
  • 11
  • 89
  • 103
  • i have gone through this link. when i change the scriptmanager to toolcriptmanager it is showing this error "Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'" – saknet Oct 05 '10 at 09:29
  • @saknet - Check my edited answer for your type load error resolution. – Sachin Shanbhag Oct 05 '10 at 09:36
  • Did not work for me. The answer below, from @Spidy, did work. –  Jul 19 '13 at 18:16
6

Try deleting Microsoft.ScriptManager.MSAjax.dll in the bin folder..

  • 2
    Never follow-up on people who suggest to delete things on your hard drive. A better suggestion would've been to rename it or relocate it. – Oliver W. Jan 28 '15 at 19:33
  • Okay.. advice noted! Thank you –  Jan 31 '15 at 15:11
  • 3
    In addition to renaming Microsoft.ScriptManager.MSAjax.dll in the bin folder, make sure it's not in the References section of your Visual Studio project. I never added it, but it ended up there anyway and bedeviled me for days until I realized it was there. – Melanie Jun 22 '16 at 19:48
1

Delete Microsoft.ScriptManager.MSAjax.dll and Microsoft.ScriptManager.WebForms.dll from your bin folder. This worked for me.

user1089345
  • 109
  • 2
  • 11
1

Use AjaxControlToolkit.dll & register it by
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

& then instead of script manager use
<cc1:ToolkitScriptManager runat="server"></cc1:ToolkitScriptManager>

Adil Waqar
  • 33
  • 1
  • 1
  • 9
1

For others hitting this problem: if you have assemblies in your bin directory that cannot be loaded, even if you do not reference them in your project, GetAjaxFrameworkAssemblyAttribute will throw an exception the first time it is loaded, then fail to work (without throwing an exception) on future loads. This issue may only happen sporadically. See Microsoft Connect Issue and Google Groups issue/work-around discussion . So, try not to stuff unusable DLLs in your bin directory.

Brian
  • 25,523
  • 18
  • 82
  • 173
1

I Think you have problem with your VS 2008 version. Because Ajax 3.5 dll requires minimum Visual studio service pack 1. But you may not have service pack 1. so please install it.

Before installing service pack 1 remove Ajax toolkit from toolbar and when installation complete again add it and run. I was also having the same problem and I have solved in this way.

akjoshi
  • 15,374
  • 13
  • 103
  • 121
B Narayan
  • 11
  • 1
0

after searching and trying many solutions, this works for me:

in projectName.csproj file, delete <Folder Include="bin\" /> in <ItemGroup>

my situation:

  1. I don't have Microsoft.ScriptManager.MSAjax.dll in the bin folder.
  2. changing <asp:ScriptManager ...> to <ajaxToolkit:ToolkitScriptManager ...> makes no sense, because there are too many tags to change
Lei
  • 378
  • 4
  • 6
0

I ran into this issue when I had a ScriptManager set up on my master page that was added as part of the default template.

The content page I was getting the error on had a ToolKitScriptManager and the master page had the ScriptManager.

I removed the ScriptManager from the master page to get rid of the error.

Here's a reference page detailing the differences between the 2. http://blog.turlov.com/2008/05/scriptmanager-vs-toolkitscriptmanager.html

Hope that helps someone!

CScott
  • 61
  • 6