当前位置:首页 » 网页前端 » web点击任意地方触发事件
扩展阅读
webinf下怎么引入js 2023-08-31 21:54:13
堡垒机怎么打开web 2023-08-31 21:54:11

web点击任意地方触发事件

发布时间: 2023-03-11 10:16:38

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

}