ASP.NET Calendar - Tutorial - Special Dates

Calendar can have unlimited number of special dates.

For each special date you can set CSS class name and a ToolTip.


Special dates are marked in red. July 4th has a special CSS class set.


<obout:Calendar runat="server" ID="Calendar1">

    <obout:SpecialDate Year="2006" Month="3" Day="20"
         ToolTip="Dentist appointment" CSSClass="mySpecialDate1"
         CSSClassOver="mySpecialDate1Over" />

    <obout:SpecialDate Year="-1" Month="7" Day="4"
         ToolTip="Independence Day" CSSClass="specialDateJuly4"
         CSSClassOver="specialDateJuly4Over" />



Use AddSpecialDate method. See documentation for details on this method.

Calendar1.AddSpecialDate(-1, 7, 4, "Independence Day", "specialDateJuly4", "specialDateJuly4Over", "");
Calendar1.AddSpecialDate(-1, 6, 14, "Special Day", "mySpecialDate1", "mySpecialDate1Over", "");
Calendar1.AddSpecialDate(-1, 6, 28, "Another special day", "mySpecialDate2", "mySpecialDate2Over", "");