[Solved] Annual calender in asp.net page [closed]


If you are using the standard ASP.NET calendar control, then you can style dates by implementing a DayRender(…) event handler. The DayRender event is raised for each day that is created for the Calendar control.

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.calendar.dayrender.aspx

Here you can check which date you are handling and style it. In your case, this is where you check if there is a note attached to the date. If so, you give it a different style.

Here’s an example that demonstrates this approach:

http://www.c-sharpcorner.com/UploadFile/puranindia/CalendarcontrolASPNET09162009030359AM/CalendarcontrolASPNET.aspx

The example marks all the Indian holidays.

Some quick code:

protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
    // Check if there is a note attached to the day (e.Day.Date) which is being 
    // rendered.
    bool hasNote = ....;

    // Style cell (which contains the date) if it has a note
    if (hasNote)
    {
       e.Cell.BackColor = System.Drawing.Color.Yellow;
    }
}

0

solved Annual calender in asp.net page [closed]