views:

272

answers:

2

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?

Thanks

<%@ 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"&gt;

<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>
+2  A: 

Try using the ajaxtoolkit ScriptManager instead of the asp one..everything else looks fine

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" > </ajaxToolkit:ToolkitScriptManager>
Ed B
+1  A: 

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 "". 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?

James Carr