How to add calendar with asp.net textbox

Add calendar with Textbox in asp.net:


In asp.net programming , Here we see the code of asp.net programming by which we can easily add a calendar with text box and you can say how to associate ajax control with asp.net programming controls ,here we go to add calendar control with textbox.

Step 1- take a text box on asp.net page .

<asp:TextBox ID="txtdate" runat="server"></asp:TextBox>
Id is this text box is ‘txtdate’

Step2-add calendar control.

<asp:CalendarExtender ID="txtdate_CalendarExtender" runat="server" Format="dd-MMM-yyyy" Enabled="True" TargetControlID="txtdate" PopupButtonID="Image1"></asp:CalendarExtender>

Step-3 take a image ;

 <asp:Image ID="Image1" runat="server" ImageUrl="~/Include/Images/Calendar_scheduleHS.png" />
For this you want to add Ajax toolkit in project and Register the contror in page of asp.net  the code for register control in asp.net page
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

Example :here we conceder a sample example




<asp:TextBox ID="txtPdate" runat="server"></asp:TextBox>
                        <asp:CalendarExtender ID="txtPostdate" runat="server" Format="dd-MMM-yyyy"
                            Enabled="True" TargetControlID="txtPdate" PopupButtonID="Image1">
                        </asp:CalendarExtender>



                        <asp:Image ID="Image1" runat="server" ImageUrl="~/Include/Images/Calendar_scheduleHS.png" />

Asp.net Controls And Examples with code :