Click here to Skip to main content
15,915,160 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi.
C#
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
    string a holiday;
    DateTime the Date=e.Day.Date;
    a holiday=holidays[the Date.Month,the Date.Day];
    if(a holiday !=Null)
    {
        Label.alabel1=new Label()
        a label.Text="<br>"+a holiday;
        e.Cell.Controls.Add(alabel);
Posted
v3

1 solution

Change your code to...
C#
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
    string aholiday;
    DateTime theDate = e.Day.Date;
    aholiday = holidays[theDate.Month, theDate.Day];

    if(aholiday !=Null)
    {
        Label alabel = new Label();
        alabel.Text = "<br>" + aholiday;
        e.Cell.Controls.Add(alabel);
    }
}
 
Share this answer
 

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