ASP.NET Mobile Calendar Control[转]

Definition and Usage
定义和用法

The Calendar control is used to display a calendar on a mobile page.
Calendar[日历] 控件的作用是:在一张移动页面上显示日历。

This control displays a one-month calendar that allows the user to select dates and move to the next and previous months.
该控件将在一页上显示一个月的日历。它允许用户选择具体的日期,并前后选择月份。


Properties
属性

Property
属性
Value
Description
描述
Alignment left
center
right
Optional. How to align the control
可选参数。指定控件的排列方式
BackColor rgb(x,x,x)
#xxxxxx
colorname
Optional. A background color for the control
可选参数。指定控件的背景颜色
BreakAfter true
false
Optional. Default is true
可选参数。默认值为“true”
 
CalendarEntryText text Optional. Specifies the text used on CHTML and WML devices to enter the Calendar control. Default is "Calendar"
可选参数。向Calendar控件中输入在CHTML 和 WML设备中使用的文本
 
EnableViewState true
false
Optional. Default is true
可选参数。默认值为“true”
 
FirstDayOfWeek Default
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Optional. Specifies the day of the week to display in the first column. If this property is set to "default" it uses the server's locale settings to determine which day of the week to display in the first column
可选参数。指定在第一列中显示星期几。如果该属性设置为“default”,那么它将自动使用服务器本地属性设置来确定在第一列中显示星期几。
ForeColor rgb(x,x,x)
#xxxxxx
colorname
Optional. A foreground color for the control
可选参数。指定控件的前景色
Font-Bold false
true
Optional. Specifies whether or not the text in the control should be bold
可选参数。指定控件中的文本字体是否以粗体显示
Font-Italic false
true
Optional. Specifies whether or not the text in the control should be italic
可选参数。指定控件中的文本字体是否以斜体显示
Font-Name fontname Optional. Specifies the font name of the text in the control
可选参数。指定空间中的文本字体名称
Font-Size normal
small
large
Optional. Specifies the font size of the text in the control
可选参数。指定空间中的文本字体尺寸
id unique_name Optional. A unique id for the control
可选参数。为空间指定一个独立的id
OnSelectionChanged function_name Optional. The name of the function to be executed when the user selects a day, week, or month
 
runat "server" Required. Specifies that the control is a server control
必要参数。指定该控件为服务器控件
SelectedDate selecteddate Optional. Specifies the currently selected date. Default is today's date
可选参数。指定当前可选择的日期。默认值为今天的日期
SelectionMode Day
DayWeek
DayWeekMonth
None
Optional. How a user is allowed to select dates. Default is Day. To disable date selection, set this property to "None"
可选参数。指定用户选择日期的方式。默认值为“日”。如果你想屏蔽这个功能,可以将其属性设置为“None”
 
ShowDayHeader true
false
Optional. Specifies whether or not the names of the days of the week should be displayed in the header of the calendar. Default is true
可选参数。指定是否需要在日历头部显示星期几的名称。默认值为“true”
StyleReference name_of_style_element Optional. Specifies a reference to a style to be applied to the control
可选参数。指定一个应用于控件的样式参数
Visible true
false
Optional.
可选参数
VisibleDate visibleDateMonth Optional. Specifies a date that specifies the month to display
可选参数。指定显示月份的日期
Wrapping wrap
nowrap
Optional. Specifies whether or not the text in the control should wrap
可选参数。指定控件中的文本是否允许被嵌套

Example 1
案例1

The following example contains two forms in an .aspx file. The first form displays a calendar. When the user select a date from the calendar, the selected date is displayed in another form:
下面的案例包含了 .aspx 文件中的两张表单。第一张表单显示了一个日历。当用户从日历中选择一个日期时,被选的日期将在另外一张表单中显示:

<%@ Page
Inherits="System.Web.UI.MobileControls.MobilePage"%>
<%@ Register TagPrefix="Mobile"
Namespace="System.Web.UI.MobileControls"
Assembly="System.Web.Mobile" %>
<script runat="server">
Sub CalChanged(sender as Object,e as EventArgs)
lbl1.Text="You selected " & c1.SelectedDate
ActiveForm=f2
End Sub
</script>
<Mobile:Form id="f1" runat="server">

<Mobile:Calendar id="c1"
OnSelectionChanged="CalChanged" runat="server" />
</Mobile:Form>
<Mobile:Form id="f2" runat="server">

<Mobile:Label id="lbl1" runat="server" />
</Mobile:Form>

posted on 2009-03-17 17:23 黄裳 阅读(...) 评论(...) 编辑 收藏

导航

统计