⑴ web控件calender怎么弄可以点击每日触发事件,为了添加日程安排,还有怎么让日程显示
调用 calender 控件的 SelectionChange方法和 OnDayRender方法
protected void myCalendar_SelectionChanged(object sender, EventArgs e)
{
this.lbText.Text = "您选择的日期是:" + this.myCalendar.SelectedDate.Month.ToString() + "月"
+ this.myCalendar.SelectedDate.Day.ToString() + "号";
this.lbText.ForeColor = Color.Blue;
}
void DayRender(Object source, DayRenderEventArgs e)
{
// Change the background color of the days in the month
// to yellow.
if (!e.Day.IsOtherMonth && !e.Day.IsWeekend)
e.Cell.BackColor=System.Drawing.Color.Yellow;
// Add custom text to cell in the Calendar control.
if (e.Day.Date.Day == 18)
e.Cell.Controls.Add(new LiteralControl("<br />Holiday"));
}