Make "meeting schedule" with ASP.net date control

Source: Internet
Author: User
Tags array length

You should be more familiar with the calendar in Outlook, the point is to choose a day, you can add the day of the schedule, and occasionally play the happy net of the brothers should also know that there is a schedule component, in fact, and outlook has a bit of brotherhood, but more beautiful than outlook :) From VS03 to VS08, ASP. NET has a calendar control, I do not know how many years after the vicissitudes of the transition, the control has changed, not very clear, because it has never been used in the project, a recent project has mentioned this requirement, the user login point "meeting Schedule" Can show the date of the current month and the corresponding date of what things, etc., first look at the following figure, and then slowly detailed:

This is the operating system of the original image, the following specific instructions to use ASP.net Calendar control to complete this function, the full demo at the end of the article has a link address for download.

The Calendar control has a DayRender event that fires when the day is rendered, and our handler code must be written under this event only to ensure that the day of the current calendar control is redrawn by loading the appropriate schedule from the database when the date is rendered.

First, define two one-dimensional arrays (and, of course, define a two-dimensional array), one to record the day of the current month, and a few days of the current month corresponding to the meeting headings, such as

int[] Intarray = new int[999];

title = new string[999];

Assuming that December is selected, the data taken from the database may be such intarray [0] = 2,intarray [1] = 2,intarray [3] = 5 The corresponding title array is this

Title[0] = "10 o'clock in the morning meeting" title [1] = "PM XX requirements Discussion" title [2] = "Customer System Demo" (No calendar days, so intarray [i] = 0, the following program jumps out of the loop based on whether the value of the item is judged by 0来 This means that December 2, there are two meeting schedules, December 5 has a schedule, here I defined the array length of 999 is equivalent to 30 times a day of the average monthly meeting, generally not to this number oh, if you read from the database of the month meeting items more than 999 times of course will be reported abnormal, Here, of course, can be read from the database dynamic, the actual necessity is not very big bar.

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.