AjaxControlToolkit requires ASP.NET scripting Ajax 4.0 Error

I am experiencing an AjaxToolkit calendar display error only in production. Locally, when debugging, this problem does not exist, and the datepicker calendar works fine. All other posts revolve around this Toolkit, which does not work at all. I am worried about why this works in a test, but not in production, since I cannot find the link anywhere in my code that uses ASP.NET ScriptManager.

The section "Site.Master" indicates

<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 a page that uses the calendar function and has Site.Master as a MasterPageFile object

 <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 during the production process:

 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 
+6
source share
5 answers

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

AjaxControlToolkit version 7.0123 with .NET 4.5

+16
source

You may also need to remove the link to the Microsoft.AspNet.ScriptManager.MSAjax.dll file in your project properties. This is what I needed to do to solve this problem.

+2
source

There was more than one in the new web application. In my new project vs2013 I had to

  • remove not only Microsoft.AspNet.ScriptManager.MSAjax.dll , but also all links like Microsoft.AspNet.ScriptManager.*
  • delete all abstract files from the bin folder
  • then rebuild the project

May it help someone! I misunderstood the above advice (my fault). Remember to remove all links made from a solution.

+2
source

http://ajaxcontroltoolkit.codeplex.com/workitem/27639

Here's how you install this old version through NuGet on the command line of the package manager console: Install-Package AjaxControlToolkit -Version 7.607.0

I ran into this problem with AjaxControlToolkit 7.1213. Going back to 7.607.0, as mlippold suggested, solved the problem for me. Thanks!

+1
source

I exclude Microsoft.AspNet.ScriptManager.MSAjax.dll from the bin directory

+1
source

Source: https://habr.com/ru/post/956023/


All Articles