让日历控件显示自定义节假日提示信息

   string[,] holiday = new string[13, 32];

    protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
    {
        holiday[7, 1] = "党的生日";
        CalendarDay c = e.Day;
        TableCell t = e.Cell;

        if (c.IsOtherMonth)
            t.Controls.Clear();
        else
        {
            string tmp = holiday[c.Date.Month, c.Date.Day];
            if(tmp!=null)
                t.Controls.Add(new LiteralControl("<br>"+tmp));

        }
    }

posted @ 2006-07-25 13:40  pensir  阅读(1404)  评论(0编辑  收藏  举报