我仅在生产环境中遇到AjaxToolkit日历显示错误。在本地调试时,这个问题不存在,日历datepicker完美工作。所有其他的帖子都围绕着这个工具包而没有工作。我关心的是为什么在测试中工作,但不是生产,因为我无法在使用ASP.NET ScriptManager的代码中找到引用。AjaxControlToolkit需要ASP.NET Ajax 4.0脚本错误
以下是关于“的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>
这是一个使用日历功能,并且具有的Site.Master作为其的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>
这是我的网站的一部分页面.config文件
<controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt" />
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
</controls>
这是生产中产生的错误:
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
修复它。我感谢您的帮助。我以为我在发布之前删除了现有的文件,但我想不是。 – Rafiki
Thx它完美的作品 – Ali
谢谢你。你为我节省了时间! – Tchaps