search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Server Side Event Handling in Daypilot Lite??

Asked by Anonymous
16 years ago.

I can not seem to get server side event handling to work, I am using the Lite version.

It will post back but not read the event Click code, I have tried adding the OnEventClick and nothing.


Comment posted by Anonymous
16 years ago.

nevermind...i got it


Comment posted by Dan Letecky
16 years ago.
Great ;-)
Comment posted by shawty
15 years ago.
Hi can you elaborate on that please, i have same issue here....

Heres Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="DayPilot" namespace="DayPilot.Web.Ui" tagprefix="DayPilot" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
<form id="form1" runat="server">

<h3>Schedular component test</h3>

<DayPilot:DayPilotCalendar ID="DayPilotCalendar1"
TimeFormat="Clock24Hours" />

<asp:Label ID="lblTest" runat="server" Text="Testing label"></asp:Label>


And here is the code behind file

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)

protected void DayPilotCalendar1_EventClick(object sender, DayPilot.Web.Ui.EventClickEventArgs e)
lblTest.Text = e.Value;
protected void DayPilotCalendar1_FreeTimeClick(object sender, DayPilot.Web.Ui.FreeClickEventArgs e)
lblTest.Text = e.Start.ToString("s");

Nothing seems to fire, no post back or anything...

I'm using VS2008 wit .NET 3.5 as a website solution.

Events where handled, using the properties panel in the IDE, so no hard wired code to create the event. Nothing seems to happen, it doesn't even generate a postback.

If i fill in the Javascript handlers they get called, no problem.

It has me stumped.

Comment posted by shawty
15 years ago.
Have just read the notes in

and still no joy :-(
Comment posted by shawty
15 years ago.
Heh... :-)

Ok, it appears i was being a pleb, iv'e sussed it....

I was changing the value of "EventClickHandling" when i should have been changing "FreeTimeClickHandling"

Lessons to be learned part 1 : Try changing everything... even if it don't seem relevent...

Sorry if i wasted anyones time...
Comment posted by Dan Letecky
15 years ago.
Hi shawty: Sorry for not responding in time and thanks for posting the solution!
Comment posted by coffmat
13 years ago.

I'm having the same problem, what is wrong with my code?

in default.aspx:

<form id="form1" runat="server">
<table cellspacing="0" cellpadding="0" border="0">
<td width="160" valign="top">
<asp:UpdatePanel ID="UpdatePanelNavigation" runat="server" UpdateMode="Conditional">
<asp:Calendar ID="Calendar1" runat="server" CssClass="calendar" DayNameFormat="FirstTwoLetters">
<TodayDayStyle BorderColor="Red" BorderStyle="Solid" BorderWidth="1px"></TodayDayStyle>
<SelectedDayStyle BackColor="#FBE694" ForeColor="Black" CssClass="selected"></SelectedDayStyle>
<TitleStyle BackColor="White"></TitleStyle>
<OtherMonthDayStyle ForeColor="#ACA899"></OtherMonthDayStyle>
<asp:ScriptManager ID="ScriptManager1" runat="server">
<td width="20">
<td valign="top" width="100%">
<asp:UpdatePanel ID="UpdatePanelCalendar" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">

<DayPilot:DayPilotCalendar ID="DayPilotCalendar1" runat="server"
DataTextField="name" DataValueField="id" TimeFormat="Clock12Hours" EventClickHandling="PostBack"
DataStartField="eventstart" DataEndField="eventend" Days="7" OnEventClick="DayPilotCalendar1_EventClick"


<asp:Label ID="Label1" runat="server" Text="Label1"></asp:Label>

below is from default.aspx.vb:

Protected Sub DayPilotCalendar1_FreeTimeClick(ByVal sender As Object, ByVal e As FreeClickEventArgs)
Label1.Text = "Time cell starting at " + e.Start & " clicked."
End Sub

Protected Sub DayPilotCalendar1_EventClick(ByVal sender As Object, ByVal e As EventClickEventArgs)
Label1.Text = "Event with ID " + e.Value & " clicked."
End Sub

Private Function dbGetEvents(ByVal start As DateTime, ByVal days As Integer) As DataTable
Dim da As New Data.SQLite.SQLiteDataAdapter("SELECT [id], [name], [eventstart], [eventend] FROM [event] WHERE NOT (([eventend] <= @start) OR ([eventstart] >= @end))", ConfigurationManager.ConnectionStrings("db").ConnectionString)
da.SelectCommand.Parameters.AddWithValue("start", start)
da.SelectCommand.Parameters.AddWithValue("end", start.AddDays(days))
Dim dt As New DataTable()
Return dt
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Request.Browser.Browser = "Firefox" Then
End If

If Not IsPostBack Then
DayPilotCalendar1.StartDate = DayPilot.Utils.Week.FirstDayOfWeek()

' select full week in the Calendar control
Dim i As Integer
For i = 0 To 7 - 1 Step i + 1
Dim selected As DateTime = DayPilotCalendar1.StartDate.AddDays(i)
DayPilotCalendar1.DataSource = dbGetEvents(DayPilotCalendar1.StartDate, DayPilotCalendar1.Days)
End If

End Sub

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.