$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Calendar Day Templates in ASP.NET
Home > How to > Calendar Day Templates

Kettic ASP.NET AJAX Calendar UI control offers users robust and reliable controls to create and customize a set of dynamic calendar templates that define the presentation of calendar days. The calendar template also contains HTML, which can be used to add extra information, such as images illustrating events, links to additional sources, etc.
Following is a sample image of calendar day template created by using Kettic asp.net Calendar Controls, each day in the calendar can display in different style, can has different background image or showing image, can has different backcolor and font color, can has different font size and font format.

asp.net calendar template day.png
This tutorial page focuses on following major two parts:
  • How to set template type within ASP.NET application
  • How to set special days by using sample ASPX codes

How to Set Template Types Within ASP.NET Project

There are two steps for creating templates by using Kettic ASP.NET AJAX Calendar components:
  1. Users can select template type by clicking the Calendar context menu, and edit template by choosing Edit Template and set the template type;
  2. Drag and drop controls from Toolbox to the template setting project, and define the any required property to create template.
Check following sample ASPX codes:

<kettic:DayTemplate ID="Template1" runat="server">
<img src="../../../../../Images/Calendar/ketticLogo.png" width="20" />
<kettic:DayTemplate ID="Birthday" runat="server">
<img src="../../../../../Images/Calendar/birthday.jpg" width="20" />
<kettic:DayTemplate ID="Disable" runat="server">
<span style="color: Red; font-weight: bold; font-size: 14px">X</span>

How to Set Special Days Within ASP.NET Project

We can easily define and set special days when we editing template. Please refer to following sample codes to set a collection of special days with the support of viable methods. If you don't like to change the calendar template in the design mode in aspx file, you can also make C# code in the web page class.

<kettic:PerCalendarDay Date="2014/06/23" Repeatable="DayAndMonth" TemplateID="Birthday">
<kettic:PerCalendarDay Date="2014/06/17" Repeatable="DayInMonth" TemplateID="Template1">
<kettic:PerCalendarDay Date="2014/06/8" Repeatable="DayAndMonth" TemplateID="Template1">
<kettic:PerCalendarDay Date="2014/6/22" IsDisabled="false" IsSelectable="false"
Repeatable="DayInMonth" TemplateID="Disable">
<kettic:PerCalendarDay Date="2014/6/14" IsDisabled="false" IsSelectable="false" Repeatable="DayAndMonth"
Here, we list all the supportable and repeatable values of web calendar templates. The respective explanation of each value is presented briefly. You can customize the asp.net calendar date value in hourly, daily, weekly, monthly, and even in yearly. So that your planning and schedule may look like wonderful and special in the web calendar.
  • DayInMonth: we can use DayInMonth control to set the special day in the template that have the ability to serve events repeated every month on the same day.
  • DayAndMonth: with the support of DayAndMonth component, the month and the day can be set to serve events repeated in a specific month on the same day.
  • Week: this control takes week day into account. This means, asp.net calendar gives the ability to serve events repeated in a specific day of the week.
  • WeekAndMonth: with WeekAndMonth control of the template, the week day and the month are taken into account to serve events repeated in a specific week day in a specific month.
  • Today: use this control to gives the ability to web calendar control the visual appearance of today's date.
  • WeekDayWeekNumberAndMonth: this component supports setting the week number, the weekday (Mon, Tue, etc.) and the month. This can be used to serve public holiday events repeated each year.
  • None: Default value, means that the day in question is a single point event, no recurrence.