Click here to Skip to main content
11,933,905 members (59,314 online)
Click here to Skip to main content
Add your own
alternative version


4 bookmarked

How to use ASP.NET AJAX Calender Extender

, 20 Jun 2012 CPOL
Rate this:
Please Sign up or sign in to vote.
How to use ASP.NET AJAX Calender Extender


This is an easy way to link ASP.NET AJAX calender with a textbox so that selecting date from calender is captured by the textbox.


There are many useful controls in ASP.NET AJAX toolkit - AJAX Calender Extender is one of them.

Using the Code

Today, I am going to demonstrate an easy way to link ASP.NET AJAX Calender Extender with a textbox so that selecting date from calender is captured by the textbox.

Important (Point to remember): Make sure you have AjaxControlToolkit.dll in your bin folder.

Add ASP.NET textbox from toolbar on your page:

<asp:TextBox ID="DateTextBox" runat="server"  />

Now add ASP.NET image tag from toolbar on your page:

<asp:Image ID="Image1" runat="server" ImageUrl="Calendar_icon.png" />

This image tag will display a small icon of calender so that the user can click on the calender icon to open up the calender tool.

Now add AJAX CalendarExtender tag on your page like this:

<ajaxToolkit:CalendarExtender ID="CalendarExtender1" 
    runat="server" TargetControlID="DateTextBox" 

The AJAX CalendarExtender makes a connection with the textbox and image tag.

Your code should look like this:

<asp:TextBox ID="DateTextBox" runat="server"  />
<asp:Image ID="Image1" runat="server" ImageUrl="Calendar_scheduleHS.png" />
<ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" 
    TargetControlID="DateTextBox" PopupButtonID="Image1">

Make sure you add this in your webconfig:

 <add tagPrefix="asp" namespace="System.Web.UI" 
assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, 
        <add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" 

That's all you need in order to make ASP.NET AJAX Calender tool work with your textbox.

For more information, please see the original article on my website (written by me) here.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Lavish Kumar
Software Developer
United States United States
Founder of Striving Programmers Online Community:

I am a programmer / web developer / software developer / graphic designer / database administrator.

Working with .NET Frameworks 2.0/3.5/4.0, MS SQL Server 2000/2005/2008, Oracle 8i/9i/10G, ASP.NET, C#.NET, VB.NET, ASP.NET AJAX, ASP.NET MVC, Web Services, JQuery, HTML, CSS, JavaScript and other programming languages .

Proficient in designing tools: Adobe Photoshop & Adobe Illustrator

You may also be interested in...

Comments and Discussions

QuestionUse of image not absolutely necessary Pin
spencepk13-Jan-15 3:52
memberspencepk13-Jan-15 3:52 
GeneralMy vote of 5 Pin
Sampath Lokuge29-Jun-13 6:33
professionalSampath Lokuge29-Jun-13 6:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151126.1 | Last Updated 21 Jun 2012
Article Copyright 2012 by Lavish Kumar
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid