How to give different appereance to some dates?

By James J

set background color to particular dates...

protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
    
if (e.Day.Date.Month == 10 && e.Day.Date.Day == 25)
    {
         e.
Cell.BackColor = System.Drawing.Color.Yellow;
    }
    
if (e.Day.Date.DayOfWeek == DayOfWeek.Friday || e.Day.Date.DayOfWeek == DayOfWeek.Saturday)
    {

         e.
Cell.Controls.Clear();
        e.
Cell.Text = "Today Is Weekend";
    }
}

How to give different appereance to some dates?  (629 Views)