?? test.aspx.cs
字號(hào):
?using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
public partial class Test : System.Web.UI.Page
{
//自定義一個(gè)二維數(shù)組,用于月日的選擇。
string [,] ViewInfo=new string[13,32];
protected void Page_Load(object sender, EventArgs e)
{
//初始化三個(gè)日期提示信息
ViewInfo[7, 15] = "奶奶的生日";
ViewInfo[7, 16] = "開(kāi)學(xué)日期";
ViewInfo[7, 14] = "發(fā)放考試成績(jī)單日";
}
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
//定義一個(gè)日期變量,用于用戶選擇的日子
DateTime infoday = e.Day.Date;
string info;
//通過(guò)數(shù)組查看是否有內(nèi)容
info = ViewInfo[infoday.Month, infoday.Day];
//判斷是否已經(jīng)自定義信息
if (info != null)
{
Label lbl = new Label();
lbl.Text = info;
//在控件內(nèi)加了一個(gè)Label,用于顯示信息
e.Cell.Controls.Add(lbl);
//改變邊框線
e.Cell.BorderStyle = BorderStyle.Solid;
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -