📄 calendar3_cs.aspx
字号:
<html>
<head>
<script language="C#" runat="server">
void Date_Selected(object sender, EventArgs e) {
switch (Calendar1.SelectedDates.Count) {
case (0): //None
Label1.Text = "No dates are currently selected";
break;
case (1): //Day
Label1.Text = "The selected date is " + Calendar1.SelectedDate.ToShortDateString();
break;
case (7): //Week
Label1.Text = "The selection is a week beginning " + Calendar1.SelectedDate.ToShortDateString();
break;
default: //Month
Label1.Text = "The selection is a month beginning " + Calendar1.SelectedDate.ToShortDateString();
break;
}
}
</script>
</head>
<body>
<h3><font face="Verdana">Selection Link Graphics</font></h3>
<p>
<form runat=server>
<asp:Calendar id=Calendar1 runat="server"
onselectionchanged="Date_Selected"
DayNameFormat="Short"
SelectionMode="DayWeekMonth"
Font-Names="Verdana;Arial" Font-Size="12px"
Height="180px" Width="230px"
TodayDayStyle-Font-Bold="True"
DayHeaderStyle-Font-Bold="True"
OtherMonthDayStyle-ForeColor="gray"
TitleStyle-BackColor="#3366ff"
TitleStyle-ForeColor="white"
TitleStyle-Font-Bold="True"
SelectedDayStyle-BackColor="#ffcc66"
SelectedDayStyle-Font-Bold="True"
NextMonthText = "<img src='images/monthright.gif' border=0>"
PrevMonthText = "<img src='images/monthleft.gif' border=0>"
SelectorStyle-BackColor="#99ccff"
SelectWeekText = "<img src='images/selweek.gif' border=0 onmouseover=this.style.backgroundColor='#ffcc66' onmouseout=this.style.backgroundColor='#99ccff'>"
SelectMonthText = "<img src='images/selmonth.gif' border=0 onmouseover=this.style.backgroundColor='#ffcc66' onmouseout=this.style.backgroundColor='#99ccff'>"
>
<SelectedDayStyle BackColor="#FFCC66" Font-Bold="True" />
<SelectorStyle BackColor="#99CCFF" />
<TodayDayStyle Font-Bold="True" />
<OtherMonthDayStyle ForeColor="Gray" />
<DayHeaderStyle Font-Bold="True" />
<TitleStyle BackColor="#3366FF" Font-Bold="True" ForeColor="White" />
</asp:Calendar>
<p>
<asp:Label id=Label1 runat="server" />
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -