How to use calendar functions in asp.net

Source: Internet
Author: User
Tags date format control label functions net
Today we are introducing the Ajax Calendar control provided by Microsoft. This control uses AJAX effects and sets events and effects through the foreground JS and style. Feature-rich, style own, real website design, MIS development of the necessary controls.

By convention, it's time to post the code:

<asp Tutorial: TextBox runat= "Server" id= "Txtcalendar" width= "/>"
<ajaxtoolkit:calendarextender runat= "Server" targetcontrolid= "Txtcalendar" CSS Tutorial class= "MyCalendar" format= " Yyyy-mm-dd "/>

Because the style is set, the code is also posted 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;
}

In this way, you will find that the YA is incredibly English, no we Chinese, which makes our love so! What do we do? Of course there is a solution, and it is easy to achieve. Not suspense, in fact, only need to set EnableScriptGlobalization and enablescriptlocalization for true on it.

Next to say the property bar, TargetControlID do not say, format is to set the display style, and C # date format is the same. PopupButtonID is clicked by the pop-up button control ID.

There are many styles:
. Ajax__calendar_container
. ajax__calendar_header
. Ajax__calendar_prev
. ajax__calendar_title

Web Control Standard Properties
accesskey, attributes, BackColor, BorderColor, BorderStyle, BorderWidth,
CssClass, Enabled, font, enabletheming, ForeColor, height, isenabled,
SkinID, Style, TabIndex, tooltip, Width for a complete description, visit the Web control standard properties.
Control label www.3ppt.com Quasi property
Apprelativetemplatesourcedirectory, Bindingcontainer, ClientID, controls,
EnableTheming, EnableViewState, ID, NamingContainer, page, parent, site,
TemplateControl, TemplateSourceDirectory, UniqueID, visible for a complete description, access the control's standard properties.

Property

Property Description . NET
Caption The title of the calendar. 2.0
Captionalign The alignment of the calendar title text. 2.0
cellpadding The space between the cell border and the content, in pixels. 1.0
CellSpacing The white space between cells, measured in pixels. 1.0
Dayheaderstyle Displays the style of the name of the day of the week. 1.0
DayNameFormat Displays the name format for each day of the week. 1.0
DayStyle Displays the style of the date. 1.0
FirstDayOfWeek Which day is the first day of the week. 1.0
Nextmonthtext Displays the text for the next month's link. 1.0
NextPrevFormat The format for the next and previous month links. 1.0
NextPrevStyle Displays the styles for the next and previous month links. 1.0
OtherMonthDayStyle Displays the style for dates that are not in the current month. 1.0
PrevMonthText Displays the text of the previous month's link. 1.0
Runat Specify that the control is a server control. Must be set to ' server '. 1.0
SelectedDate The date selected. 1.0
SelectedDates The date selected. 1.0
SelectedDayStyle The style of the selected date. 1.0
SelectionMode Allows users to select a date. 1.0
SelectMonthText Displays the text for the selection link for the month. 1.0
Selectorstyle The style of the selection link for the month and week. 1.0
Selectweektext The text displayed as the selection link for the week. 1.0
ShowDayHeader A Boolean value that indicates whether to display the headers for each day of the week. 1.0
Showgridlines Boolean value that indicates whether gridlines between dates are displayed. 1.0
Shownextprevmonth Boolean value that stipulates whether the next and previous month links are displayed. 1.0
Showtitle Boolean value that stipulates whether the actual date of the caption. 1.0
TitleFormat The format of the date caption. 1.0
TitleStyle The style of the date caption. 1.0
TodayDayStyle The style of the day's date. 1.0
TodaysDate Gets or sets the value of today's date. 1.0
Useaccessibleheader Specify whether to use <th> instead of <td> elements for the head of the day. 2.0
VisibleDate Gets or sets the date that specifies the month to display on the Calendar control. 1.0
WeekendDayStyle The style of the weekend. 1.0
Ondayrender The name of the function that is executed when the cell of each day is created.
OnSelectionChanged The name of the function that is executed when the user selects the day, week, or month.
Onvisiblemonthchanged The name of the function that is executed when the user navigates to a different month.


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.