3

I was trying to use a calendar extender but for some reasons it not working? Just put a simple TextBox and CalendarExtender, when I click inside the textbox it supposed to be popup the calendar, but I got nothing.

On the other hand, I tried the ConfirmButtonExteder and it work fine.

I don't know if something wrong, maybe I missing something in web.config? but why the ConfirmButtonExtender works?

I use VS 2012, ASP.NET C#, .NET Framework 4.5, Ajax toolkit 4.1.7.725 (latest one from official website) then Install the Ajaxtoolkit it from Nuget (version 4.5...) but still samething, the calendar is not popup, the confirmbuttonextender works just fine. I dont know why?

Here my code:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="MainContent">
    <p>
        <ajaxToolkit:ToolkitScriptManager runat="server" ID="ScriptManager1" /    
        <asp:Button ID="Button1" runat="server" Text="Button" />
        <ajaxToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server" TargetControlID="Button1"></ajaxToolkit:ConfirmButtonExtender>
        <br />
        <asp:TextBox runat="server" ID="Date1"/>
        <br />
        <ajaxToolkit:CalendarExtender ID="defaultCalendarExtender" runat="server" TargetControlID="Date1" />
    </p>
</asp:Content>
abatishchev
  • 98,240
  • 88
  • 296
  • 433
Ronaldinho Learn Coding
  • 13,254
  • 24
  • 83
  • 110
  • try to install the toolkit from Nuget, if you haven't done it that way. someone in my team had a similar issue, we tried Nuget to get the toolkit and everything started working after that. Nuget is an option in Visual Studio, right click on your solution and there should be option to manager Nuget packages. – Paritosh Aug 01 '13 at 14:26
  • Where did you place the ScriptManager? Make sure it's inside the tags – Harold Javier Aug 01 '13 at 15:02
  • Another thing, you can delete the Enabled=true inside the CalendarExtender. Here's my sample: http://www.dotnetfrommanila.blogspot.com/2013/04/calendar-extender-101.html – Harold Javier Aug 01 '13 at 15:07
  • @HaroldJavier As you can see I put ToolkitScriptManager inside the asp Content "MainContent" which is body of my page. Deleted Enabled=true but it still not working, on the hand, the ConfirmButtonExtender works fine??? – Ronaldinho Learn Coding Aug 01 '13 at 15:13
  • @Paritosh I installed AjaxToolkit 4.5 from Nuget but still samething?? – Ronaldinho Learn Coding Aug 01 '13 at 15:13
  • Try to replace your TagPrefix="asp" to TagPrefix="otherName". I didn't know what happened but when I tried that it worked for me.... – Harold Javier Aug 01 '13 at 15:31
  • @HaroldJavier I tried another tagprefix but it still not working, what did you put in Web.Config about the AjaxToolKit? – Ronaldinho Learn Coding Aug 01 '13 at 15:36
  • You don't need to put it in web.config if you already placed it on top of your page. – Harold Javier Aug 01 '13 at 16:14
  • @HaroldJavier yeah I know, put it on Web.config so you dont have to register it on top of every pages. Either ways it still not popup the calendar gruuuuuuu – Ronaldinho Learn Coding Aug 01 '13 at 16:17
  • Do you have any message in browser's console? – Yuriy Rozhovetskiy Aug 01 '13 at 17:34
  • @YuriyRozhovetskiy I got nothing, no browser error, no VS debug error, tried both on IE and FireFox, same thing => click to textbox and nothing happened. – Ronaldinho Learn Coding Aug 01 '13 at 17:38
  • Did u find any solution? I have faced the same problem in VS2013 though the same code worked for VS2010... – Teju MB Apr 17 '14 at 03:40

1 Answers1

0

Here's what you can do:

  1. Check that AjaxControlToolkit.dll and AjaxControlToolkit.pdb are in your Bin Folder.

  2. Place the assembly <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> above the page.

  3. Make sure the ScriptManager is below the BodyContent of ContentPlaceHolder

     <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
     <asp:ScriptManager ID="ScriptManager1" runat="server">
     </asp:ScriptManager>
    
  4. Double-Check the TagPrefix and the TargetControlID of the CalendarExtender

     <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1">
    

Harold Javier
  • 887
  • 2
  • 7
  • 16