locked
JavaScript runtime error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts RRS feed

  • Question

  • User-1879545088 posted

    I am looking to install the Ajax tool kit. I was able download the sample from codeplex.

    And following instructions, I was able to launch + try the sample site included in the zip file. 

    I am using vs2013 and running everything local on my computer (using vs2013 built in web server to test + try this).

    I thus used the AjaxControlTookitBinary.NET45 version.

     

    I am able to run the sample website from vs2013. And if I create a new project + web site and COPY the WHOLE sample web site into that folder (overwriting everything), then again I find the tool kit works. 

    And the steps to add the controls to the tool box also seems to have worked fine.

     

    I now created a new site from vs2013 (FILE- new site). 

    If create a blank page and drop in the ToolScriptManager as the FIRST step, then I now have this:

     

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" %>

    <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %> 

    <!DOCTYPE html>

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">

        <title></title>

    </head>

    <body>

        <form id="form1" runat="server">

            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">

            </asp:ToolkitScriptManager>

        <p>

            Hello

        </p>

        </form>

    </body>

    </html>

     

    When I attempt to run this page with F5, I get this message:

     

    unhandled exception at line 22, column 5 in http://localhost:55267/ScriptResource.axd?d=Hm 

    PHS4c8DJOsyehLgTYT9GMvdLZ_65LcQvbOT-Hs4aNkbWXOPg5hTei9LqAL9F7bHjxmNugEAxceCOtkOKzRBaWjUZdaSa4CnjO6dBNPyh1cqPFCXFtwQWSzIwb-K25j0&t=ffffffffda74082d

    0x800a139e - JavaScript 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.

    How does one go about adding the 4.0 Ajax scripts to new web sites? Are these scripts to be copied from the original sample site and then placed in the scripts folder, or are these a set of scripts I need to reference during development?

     

    I am having much difficulty resolving this. Some suggest to change the tag prefix to something other then asp for the TookKitScriptMananger?. I tried using cc1 as per this example and no change: 

    http://forums.asp.net/t/1506194.aspx

    Does anyone have a step by step on how to place + use the ToolScriptManager onto a page and then resolve the missing 4.0 scripts error I receive above? I just upgraded to vs2013 and I having a real struggle (loved vs2010!!!).

     I as a last resort copied the Bin folder from the sample download into the bin folder for this site and + added the references to AjaxControlToolkit.dll in that bin folder.  This did not help. 

    Any help on this mystery problem is appreciated.

     

    Best regards,

    Albert D. Kallal (Access MVP)

    Edmonton, Alberta Canada

     

    Monday, December 23, 2013 9:05 AM

Answers

  • User-1879545088 posted

    I did try creating a few empty sites and staring over each time. 

    However, I have NOW fixed this.

    I just used NuGet to install the AjaxControlToolkit and all is well.

    I have avoided NuGet in the past since I kind of want to be able to install such libraries on my own (since then when transferring to a real production server I often will not have use of NuGet).

    However, for the time being, creating a blank new site and THEN using NuGet to install the Ajax tools kit did the trick. This is a much cleaner setup then my "forced" copy of all the folders from the sample Ajax web site.

    I very MUCH appreciate your follow up here.

    I wish I could offer a better step by step solution to everyone her for my fix. And I could/should  spend time to check if installing with NuGet makes changes to web config that I may have missed – but using  NuGet certainly was easy – too easy!

    Now, even creating new sites from scratch – dropping in the TookScriptContorl sets up all references – I don't have to really do a thing other than that one  drag + drop to make this work!

    So the Ajax controls now work – and wow – they are oh so easy to drop into a form – and fun to use!!

    Again, thanks, and best regards,

    Albert D. Kallal (Access MVP)

    Edmonton, Alberta Canada

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 24, 2013 2:11 AM

All replies

  • User1734617369 posted

    Hi,

    If you have created the new site using the ASP.NET Web Forms Site template there can be a conflict between the AjaxToolkit and the Microsoft.ScriptManager.MSAjax.dll, this have been an issue with certain versions of the toolkit. If you create an empty site do you have the same problem?

    Best regards
    Johan

    Monday, December 23, 2013 10:40 AM
  • User-1879545088 posted

    I did try creating a few empty sites and staring over each time. 

    However, I have NOW fixed this.

    I just used NuGet to install the AjaxControlToolkit and all is well.

    I have avoided NuGet in the past since I kind of want to be able to install such libraries on my own (since then when transferring to a real production server I often will not have use of NuGet).

    However, for the time being, creating a blank new site and THEN using NuGet to install the Ajax tools kit did the trick. This is a much cleaner setup then my "forced" copy of all the folders from the sample Ajax web site.

    I very MUCH appreciate your follow up here.

    I wish I could offer a better step by step solution to everyone her for my fix. And I could/should  spend time to check if installing with NuGet makes changes to web config that I may have missed – but using  NuGet certainly was easy – too easy!

    Now, even creating new sites from scratch – dropping in the TookScriptContorl sets up all references – I don't have to really do a thing other than that one  drag + drop to make this work!

    So the Ajax controls now work – and wow – they are oh so easy to drop into a form – and fun to use!!

    Again, thanks, and best regards,

    Albert D. Kallal (Access MVP)

    Edmonton, Alberta Canada

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 24, 2013 2:11 AM