Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
While Display A Calender

Sunday (Weekend) Column in Red Or Any Other Color Through CSS
Posted
Updated 4-Jun-12 20:16pm
v3

 
Share this answer
 
you can use the asp:calendar control.

XML
<asp:Calendar ID="Calendar1" ShowGridLines="true" CellPadding="15"  runat="server"
          OnDayRender="Calendar1_DayRender"  OnSelectionChanged="Calendar1_SelectionChanged  ">

          </asp:Calendar>



C#
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
    if (e.Day.IsWeekend) {
        e.Cell.BackColor = System.Drawing.Color.Aqua;
    }
}
 
Share this answer
 
v4
Comments
sivasankari ts 5-Jun-12 3:18am    
if in case of ajax calendar control,please use the "onprerender" event

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900