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

Kettic ASP.NET Ajax Calendar controls all raise server-side events, by using which users are able to use to set the parts of the control as they are created, or to respond in the code-behind when the user makes a change. Calendar offers four server-side events: DayRender, HeaderCellRender, SelectionChanged, and DefaultViewChanged.

DayRender in ASP.NET

Kettic ASP.NET Calendar control offers users the DayRender server event, which is raised after all the cells of the day matrix have been generated and just before a cell is rendered to the client. This event occurs rapidly before the calendar renders the cell for a single day in the day matrix.

HeaderCellRender in ASP.NET

Kettic ASP.NET Calendar control provides the HeaderCellRender server event, which is raised after all the row and column headers and the view selector have been generated and just before one of these header cells is rendered to the client. Like DayRender, this is the last place where changes to the already constructed header cells can be made.

SelectionChanged in ASP.NET

Kettic ASP.NET Calendar control offers the SelectionChanged server event, which is raised when the PostBack property is set to true, and user can change the current selection by selecting or unselecting a date in the calendar. This event does not fire unless the PostBack property is True.
Following sample ASPX codes are for SelectionChanged server side.

<kettic:PerCalendarID="PerCalendar1"runat="server"
TitleFormat="MMMM yyyy"AutoPostBack="true"
OnSelectionChanged="SelectedDateChange">
</kettic:PerCalendar>
Please refer to following C# code for SelectionChanged server side.

protectedvoidSelectedDateChange(object sender, SelectedDatesEventArgs e)
{
string date = e.SelectedDates.Count - 1 >= 0 ? e.SelectedDates[e.SelectedDates.Count - 1].Date.ToString() : "none";

txtLog.Text += "Changed Date to: \"" + date + "\"\r\n";
}

DefaultViewChanged in ASP.NET

DefaultViewChanged event will arise when the user changes the current calendar view by using the navigation controls in the calendar title bar. This event does not occur unless the AutoPostBack property is True.
We give following ASPX demo codes to guide users to set DefaultViewChanged server event.

<kettic:PerCalendarID="PerCalendar1"runat="server"
TitleFormat="MMMM yyyy"AutoPostBack="true"
OnDefaultViewChanged="NavigationChanged">
</kettic:PerCalendar>
Please check out C# example codes below to set DefaultViewChanged server event if you are C# language developers or end users.

protectedvoidNavigationChanged(object sender, DefaultViewChangedEventArgs e)
{
txtLog.Text += "Default view changed to: \"" + PerCalendar1.CalendarView.TitleContent + "\"\r\n";
}

See More Relevant Tutorials

This page talks about how to set calendar server side events by using ASPX or C# codes with the support of KT.UI for ASP.NET AJAX. Besides this, we still offer more calendar server programming - picker event settings by using ASPX codes and C# codes. In addition, if you want to set the calendar client side events, you can get help via this quick access.
ASP.NET AJAX UI Controls