⑴ 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"));
}