1

I want to use calender extender from Ajax toolkit but it not showing in targeted textbox.

I'm using this code:

<asp:TextBox runat="server" ID="txtDate1" />
<asp:CalendarExtender ID="txtDate1_CalendarExtender" runat="server" Enabled="True" TargetControlID="txtDate1">
</asp:CalendarExtender>

Then I even put Script Manager.

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

and this,

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

Which may be the reason for this? Any help?

Nishantha
  • 6,065
  • 6
  • 33
  • 51
  • 1
    You tagged this question as JavaScript and jQuery. Why? Did you try debugging in the browser debugger and see a JavaScript error? – mason Dec 19 '13 at 20:14
  • 1
    Check in your bin folder you have AjaxControlToolkit.dll and AjaxControlToolkit.pdb are available or not ? – Chandan Kumar Dec 19 '13 at 20:26
  • AjaxControlToolkit.dll is in but not AjaxControlToolkit.pdb. Any reference to add?? – Nishantha Dec 19 '13 at 20:35
  • 1
    download ajaxcontroltoolkit from http://ajaxcontroltoolkit.codeplex.com/releases/view/116091 and add all language pack along with .pdb and .dll file inside your bin folder. – Chandan Kumar Dec 19 '13 at 20:42
  • 1
    Since you are using the ajax control toolkit you will need to use ToolScriptManager instead of just ScriptManager. – Humpy Dec 19 '13 at 21:32

2 Answers2

3

Try replacing ScriptManager with ToolkitScriptManager

<asp:ToolkitScriptManager runat="server"></asp:ToolkitScriptManager>

and make sure your ToolkitScriptManager is right after your

<form id="form1" runat="server">
Pramesh
  • 1,194
  • 12
  • 16
1

Since you tagged this question as jQuery, might I suggest an alternative? jQuery UI has an excellent datepicker, if you're willing to add jQuery UI to your project.

$(function () {
     $("#<%=txtDate1.ClientID %>").datepicker({ dateFormat: "mm/dd/yy", changeMonth: true, changeYear: true });
});
mason
  • 31,774
  • 10
  • 77
  • 121