Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts Error

I'm experiencing a AjaxToolkit Calendar display error in production only. Locally when debugging, this problem does not exist and the calendar datepicker works perfectly. All of the other posts revolve around this Toolkit not working at all. I'm concerned with why this works in test but not production since I can't find a reference anywhere in my code that uses ASP.NET ScriptManager.

The following is on "Site.Master"

<ajaxToolKit:ToolkitScriptManager runat="server">
    <Scripts>
        <%--Framework Scripts--%>            
        <%--<asp:ScriptReference Name="jquery" />--%>
        <%--<asp:ScriptReference Name="jquery.ui.combined" />--%>
        <asp:ScriptReference Path="~/Scripts/WebForms/WebForms.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/WebUIValidation.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/MenuStandards.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/GridView.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/DetailsView.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/TreeView.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/WebParts.js" />
        <asp:ScriptReference Path="~/Scripts/WebForms/Focus.js" />
        <asp:ScriptReference Name="WebFormsBundle" />
        <%--Site Scripts--%>

    </Scripts>
</ajaxToolKit:ToolkitScriptManager>

This is the page that uses the Calendar function and has Site.Master as its MasterPageFile

<asp:Label ID="DateRangeLabel" runat ="server" Text="Date Range: "></asp:Label>
<asp:TextBox ID="DateFrom" runat="server" Width="95px"></asp:TextBox>
<ajaxtoolkit:calendarextender ID="Calendarextender" runat="server" TargetControlID="DateFrom" PopupPosition="BottomLeft" Format="MM/dd/yyyy"></ajaxtoolkit:calendarextender>
<asp:TextBox ID="DateTo" runat="server" Width="95px"></asp:TextBox>
<ajaxtoolkit:calendarextender ID="Calendarextender1" runat="server" TargetControlID="DateTo" PopupPosition="BottomLeft" Format="MM/dd/yyyy"></ajaxtoolkit:calendarextender>

This is part of my Web.config file

<controls>
    <add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />        
    <add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
</controls>

This is the error that is generated in production:

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

Uncaught TypeError: undefined is not a function  MicrosoftAjax.js:6
like image 237
Rafiki Avatar asked Oct 15 '13 21:10

Rafiki


People also ask

What is AjaxControlToolkit DLL?

AjaxControlToolkit contains a rich set of controls that you can use to build highly responsive and interactive AJAX-enabled Web applications. AjaxControlToolkit contains more than 40 controls, including the AutoComplete, CollapsiblePanel, ColorPicker, MaskedEdit, Calendar, Accordion, and Watermark controls.

How do I reference AjaxControlToolkit?

Right Click the References in Solution Explorer and select Add Reference,Select "Browse" Tab, Select AjaxToolkit. dll from the "bin" folder from your project folder.

How can I download Ajax Toolkit for Visual Studio 2010?

Open your browser and go to the official website of Ajax toolkit ASP.NET AJAX Control Toolkit. There you will find ASP.NET Ajax Control Toolkit v15. 1. Just click on that and your download will start.


1 Answers

You might want to try removing Microsoft.AspNet.ScriptManager.MSAjax.dll from bin folder on the server if exists.

AjaxControlToolkit version 7.0123 with .NET 4.5

like image 188
Win Avatar answered Oct 20 '22 19:10

Win