asp.netajaxcalendarextender

ASP.NET and AJAX - CalendarExtender isn't working


Brand new to AJAX. I want to add it to Visual Studio (2015 version).

I downloaded AJAX and added the .dll file to my Bin in my web app. Then I went into my Toolbox and added a new tab for this .dll file.

Then I added this to my web.config:

 <controls>
        <add tagPrefix="ajaxtoolkit"
                   namespace="AjaxControlToolkit"
                   assembly="AjaxControlToolKit"/>
      </controls>

I added this to my master page:

<asp:ScriptManager ID="ScriptManager1" runat="server" />

I have this on a webform page (and a page using my master page template):

<asp:TextBox ID="TxtRegStart" runat="server" CssClass="formtextbox"></asp:TextBox>

<asp:CalendarExtender ID="TxtRegStart_CalendarExtender" runat="server" TargetControlID="TxtRegStart"></asp:CalendarExtender>

The CalendarExtender doesn't do anything... why? (Clicking in the textbox doesn't pull up a calendar.) What did I forget to do?

UPDATE

I got it to work. I had to change my code on my master page from this <asp:ScriptManager ID="ScriptManager1" runat="server" /> to this:

<ajaxtoolkit:ToolkitScriptManager runat="Server" EnableScriptGlobalization="true" EnableScriptLocalization="true" ID="ScriptManager1" ScriptMode="Debug" CombineScripts="false" /> 

Solution

  • I thing the problem is because you are writing

    <asp:CalendarExtender ....>
    

    instead, try this

    <ajaxtoolkit:CalendarExtender ....>
    

    because you define the TagPrefix was ajaxtoolkit here:

    <controls>
        <add tagPrefix="ajaxtoolkit"
             namespace="AjaxControlToolkit"
             assembly="AjaxControlToolKit"/>
    </controls>