Today, we'll take you to the task. Learn how to use calendar controls in ASP.net, the main task content:
1, add a calendar, set the date to the full name of the blue display, the weekend with a yellow background red text display, and the current date with a green background display, the user can choose a day, week or whole month, the selected day/week/month with a gray background color to display. After a date is selected, display the time in one of the following text boxes, as shown in the figure:
2, design a registration page, use the JS Calendar control to help users enter the date of birth. The effect is as shown in the figure:
Learn Project One Calendar control
1, create a calendar page under the site, and drag and drop a TextBox control on the page to enter a date, a CALENDAR1 Calendar control for its property settings, set the date with the full name of Blue, the weekend with a yellow background red text display, The current date is displayed with a green background, the user can select a day, a week, or the entire month, and the selected day/week/month is displayed with a gray background color.
2. When the page is running, the SelectionChanged event is triggered when the user selects a date on the Calendar1 control. Write the following code in the Calendar.aspx.cs file:
protected void Calendar1_SelectionChanged (object sender, EventArgs e)
{
Textbox7.text = Calendar1.SelectedDate.ToString ();
}
Learning Project two JS Calendar control
(1) Create a jscalendar.aspx page file under the site, add a TextBox control to the page, and write the following code in jscalendar.aspx.