How to Use the Calendar function Calendar in asp.net

Source: Internet
Author: User

Today we will introduce the ajax calendar control provided by Microsoft. This control uses ajax effects and sets events and effects through front-end js and style. Rich functions and styles are essential for website design and mis development.

By convention, it is now time to paste the Code:

<Asp Tutorial: textbox runat = "server" id = "txtcalendar" width = "150"/>
<Ajaxtoolkit: calendarextender runat = "server" targetcontrolid = "txtcalendar" css tutorial class = "mycalendar" format = "yyyy-mm-dd"/>

Because the style is set, we can paste the code here, just write a simple style:
Copy codeThe Code is as follows:
. Mycalendar. ajax _ calendar_container {
Border: 1px solid #646464;
Background-color: maroon;
Color: red;
}

When we run this way, you will find that the English language is poor, and we do not have any Chinese. What makes us feel so embarrassed! What should we do? Of course, there are solutions that can be easily implemented. If you do not want to sell off the customs, you only need to set enablescriptglobalization and enablescriptlocalization to true.

Let's talk about the attributes. targetcontrolid is not mentioned. format is the display style, which is the same as the date format in c. Popupbuttonid is the id of the pop-up button control.

There are many styles:
. Ajax _ calendar_container
. Ajax _ calendar_header
. Ajax _ calendar_prev
. Ajax _ calendar_title

Standard properties of web controls
Accesskey, attributes, backcolor, bordercolor, borderstyle, borderwidth,
Cssclass, enabled, font, enabletheming, forecolor, height, isenabled,
For a complete description of skinid, style, tabindex, tooltip, and width, visit the standard properties of the web control.
Quasi-attribute of the control on www.3ppt.com
Apprelativetemplatesourcedirectory, bindingcontainer, clientid, controls,
Enabletheming, enableviewstate, id, namingcontainer, page, parent, site,
Templatecontrol, templatesourcedirectory, uniqueid, and visible. For a complete description, visit the standard properties of the control.

Attribute

Attribute Description . Net
Caption The title of the calendar. 2.0
Captionalign Alignment of the calendar title text. 2.0
Cellpadding The gap between the cell border and content, in pixels. 1.0
Cellspacing The gap between cells, in pixels. 1.0
Dayheaderstyle Display the style of the name of a day in a week. 1.0
Daynameformat Display the name format of each day of the week. 1.0
Daystyle Display the date style. 1.0
Firstdayofweek Which day is the first day of the week. 1.0
Nextmonthtext Displays the text of the January link. 1.0
Nextprevformat The format of the link for the next month and the last month. 1.0
Nextprevstyle Shows the style of the link between January 1, January and January 1, January. 1.0
Othermonthdaystyle Display the style of the date that is not in the current month. 1.0
Prevmonthtext Displays the text of the link for the last month. 1.0
Runat Specifies that the control is a server control. Must be set to "server ". 1.0
Selecteddate The selected date. 1.0
Selecteddates The selected date. 1.0
Selecteddaystyle The style of the selected date. 1.0
Selectionmode How to select a date. 1.0
Selectmonthtext Displays the text of the selected link for the month. 1.0
Selectorstyle Select the link style of month and week. 1.0
Selectweektext Displays the text of the selected link for the week. 1.0
Showdayheader Boolean value indicating whether to display the headers of days in a week. 1.0
Showgridlines Boolean value that specifies whether the grid lines between dates are displayed. 1.0
Shownextprevmonth Boolean value, specifying whether to display the link between March 13, and last month. 1.0
Showtitle Boolean value that specifies whether the title of the actual date is used. 1.0
Titleformat The format of the Date title. 1.0
Titlestyle The style of the Date title. 1.0
Todaydaystyle The date style of the day. 1.0
Todaysdate Obtain or set the value of today's date. 1.0
Useaccessibleheader Specifies whether to use the <th> element instead of the <td> element for the day's header. 2.0
Visibledate Gets or sets the date of the month to be displayed on the calendar control. 1.0
Weekenddaystyle Weekend style. 1.0
Ondayrender The name of the function executed when the cell of each day is created.  
Onselectionchanged The name of the function to be executed when you select day, week, or month.  
Onvisiblemonthchanged The name of the function to be executed when you navigate to different months.

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.