Asp. NET and how to use the Calendar control and the JS version of the Calendar control

Source: Internet
Author: User
Today, we will take you to do the task of the form to understand the use of the Calendar control ASP, the main task content:
1, add a calendar, set the date in blue full name display, the weekend with yellow background red text display, and the current date with a green background display, the user can choose a day, a week or an entire month, the selected day/week/month with a gray background color to display. After a date is selected, the time is displayed in one of the following text boxes, with the effect:

2, design a registration page, using the JS Calendar control to help users enter the date of birth. Effect:

Learning Project A 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 to set its properties, set the date to display the full name of Blue, the weekend with yellow background red text display, While the current date is displayed with a green background, the user can select a day, week, or whole month, and the selected day/week/month is displayed using 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 Item two JS Edition 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.


(2) When you move the cursor over a TextBox control, it is activated to display the calendar

Run:

The above is the entire content of this article, I hope that you learn the ASP. NET in the use of the Calendar control method is helpful.

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.