Asp. How to use the Calendar control and the JS Calendar control in net (section 5th) _ Practical Tips

Source: Internet
Author: User

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.


 
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.