ASP.NET provides a simple calendar control to use calendar and select date in your page. Like other controls of ASP.NET, calendar control has attributes and events which you can you to achieve your desired functionality. You can also set different themes and styles for this calendar control. This is very flexible control and you can attach selected date with label of text box.
Here is the calendar control example in ASP.NET. You can also download code at the bottom.
First look at the aspx page code
<asp:Label ID="lblSelectedDate" runat="server" ></asp:Label>
<asp:TextBox ID="txtSelectedDate" runat="server"></asp:TextBox>
<asp:Label ID="lblSelectedMonth" runat="server" ></asp:Label>
<asp:Calendar ID="Calendar1" runat="server"
<DayHeaderStyle ForeColor="#FF9966" />
<WeekendDayStyle BackColor="#99CC00" />
I have used a label and a Text Box to display the select date. In calendar control you can see, I have set different attributes of the control. You can set these and many other attributes according to your requirements. I have also used an event of Calendar control which is OnSelectionChanged. We can display or use selected date in this event.
Now see the OnSelectionChanged event of Calendar control in Code behind file (C#)
protected void Calendar1_SelectionChanged(object sender, System.EventArgs e)
lblSelectedDate.Text = "Your selected Date is: " + Calendar1.SelectedDate.ToShortDateString();
txtSelectedDate.Text = Calendar1.SelectedDate.ToShortDateString();
You can see, I have simply assigned selected data of Calendar control to Label and Text Box in OnSelectionChanged event.Best WordPress Themes and Plugins with Great Team and Support!