⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 calendar4_cs.aspx

📁 一些标准控件的举例说明
💻 ASPX
字号:
<html>
<head>
    <script language="C#" runat="server">

        void Date_Selected(object s, 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 Text</font></h3>
    <p>

    <form runat=server>

        <p>
        <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"
            NextPrevFormat="ShortMonth"
            NextPrevStyle-ForeColor="white"
            NextPrevStyle-Font-Size="10px"
            SelectorStyle-BackColor="#99ccff"
            SelectorStyle-ForeColor="navy"
            SelectorStyle-Font-Size="9px"
            SelectWeekText = "week"
            SelectMonthText = "month"
            >
            <SelectedDayStyle BackColor="#FFCC66" Font-Bold="True" />
            <SelectorStyle BackColor="#99CCFF" Font-Size="9px" ForeColor="Navy" />
            <TodayDayStyle Font-Bold="True" />
            <OtherMonthDayStyle ForeColor="Gray" />
            <NextPrevStyle Font-Size="10px" ForeColor="White" />
            <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 + -