Reputation: 3173
I've made a new project with one page and a reference to AjaxControlToolkit.dll
The calendar extender below doesn't work, what have I done wrong?
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<ajaxToolkit:CalendarExtender runat="server" TargetControlID="TextBox1" CssClass="ClassName" Format="MMMM d, yyyy" />
</div>
</form>
</body>
</html>
Upvotes: 7
Views: 41794
Reputation: 834
Sigh... I know this is question was dated, but in case others arrive and these solutions don't solve the problem then here is something to check. We have a legacy web forms app that I spent most of the morning troubleshooting because the calendar extender controls just stopped working on a specific page. There were no patches or service packs that had been run on server/local dev pc and no Ajax assembly version change and no recent change to the page.
It turns out that a register startup script in page load was referring to a JavaScript function that no longer existed in the external js file hence a JavaScript Error on page load stopped the ajax control initialization/functionality. So check your developer tools (Chrome seems the best) for JavaScript errors that may stop other JavaScript initialization scripts from running for calendar extender and similar.
Upvotes: 0
Reputation: 4607
Since it is already answered, but just to let the developers facing this problem NOW , talking about the version Update October 2015: which is now maintained by DevExpress
I upgraded my VS 2013 Web Forms application project to ajax via Nuget
&
I faced the same problem, Calender control not working, having all the code perfect
So the solution that worked for me was :
1. I did this:
2. I installed it via this New installer
3. I created a New project in my VS 2013
4. Moved my existing code to this project and
plus,
thers is no <ajaxToolkit:ToolkitScriptManager
now , you have to Use the standard ScriptManager now
Upvotes: 1
Reputation: 6685
regarding Ajax Control Toolkit 7.1213.0
Since you are using the ajax control toolkit you will need to use ToolScriptManager instead of just ScriptManager.
Drag and drop ToolScriptManager or just type
<asp:ToolkitScriptManager runat="server"></asp:ToolkitScriptManager>
if not working put this in the begining of web page.
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
You can use CalendarExtender right after targeted textbox.
<asp:TextBox runat="server" ID="txtDate1" />
<asp:CalendarExtender ID="txtDate1_CalendarExtender" runat="server" Enabled="True" TargetControlID="txtDate1">
</asp:CalendarExtender>
If these are not working you should edit your Web.config file and add necessary configurations. Add configurations to ajax controls which will need you to refer another tutorial.
Upvotes: 2
Reputation: 11
<httpHandlers>
<remove path="*.asmx" verb="*"/>
<add path="*.asmx" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add path="CrystalImageHandler.aspx" verb="GET" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=10.2.3600.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
<add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>
</httpHandlers>
<system.web></system.web>
Upvotes: 1
Reputation: 51
No, Its what ever you set the tagPrefix as, It could be cc1 or asp or ajaxToolkit
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
Upvotes: 5
Reputation: 129
The above answer is correct; however, it didn't work for me. I tried instead to drag the ToolkitScriptManager into my form, and it was rendered as
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>"<. It worked for me then. Note that it was "asp.ToolkitScriptManager", not "ajaxToolkit:ToolkitScriptManager". Perhaps this is a change in the version of the Ajax Control Toolkit I am using?
Upvotes: 5
Reputation: 6054
Try using the ajaxtoolkit ScriptManager instead of the asp one..everything else looks fine
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" > </ajaxToolkit:ToolkitScriptManager>
Upvotes: 21