如何在asp.net日历控件中禁用Sunday?我正在使用C#。
答案 0 :(得分:5)
您可以在控件中为dayrender事件创建方法。像这样:
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.Date.DayOfWeek != DayOfWeek.Sunday) return;
e.Cell.ApplyStyle(new Style { BackColor = System.Drawing.Color.Gray });
e.Day.IsSelectable = false;
}