Asp.net programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this Asp.net and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Asp.net Website by URL, How to Play YouTube Videos in Asp.net by using Jquery , Jquery Change div background on mouseover in asp.net , JQuery UI Datepicker (Calendar) etc.

Friday, September 13, 2013

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 :