DayPilot Forums

DayPilot is the best open-source Outlook-like calendar control for ASP.NET.
DayPilot Pro Demo (Calendar control)
» DayPilot Pro live demo (Calendar control)
DayPilot Pro Demo (Scheduler control)
» DayPilot Pro live demo (Scheduler control)
Home » DayPilot Lite » Server Side Event Handling in Daypilot Lite??

Server Side Event Handling in Daypilot Lite??

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.

??

Anonymous - 4/3/2008 5:25:39 PM

nevermind...i got it

:)

Anonymous - 4/3/2008 5:36:05 PM
Great ;-)
Dan Letecky - 4/10/2008 12:08:08 AM
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" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

<h3>Schedular component test</h3>

<DayPilot:DayPilotCalendar ID="DayPilotCalendar1"
runat="server"
BusinessBeginsHour="6"
BusinessEndsHour="15"
Days="4"
JavaScriptEventAction=""
JavaScriptFreeAction=""
oneventclick="DayPilotCalendar1_EventClick"
onfreetimeclick="DayPilotCalendar1_FreeTimeClick"
TimeFormat="Clock24Hours" />

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

</div>
</form>
</body>
</html>

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.

:-)
shawty - 7/4/2008 8:57:45 AM
Have just read the notes in

http://forums.daypilot.org/Topic.aspx/8/event_handling

and still no joy :-(
shawty - 7/4/2008 9:11:35 AM
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...
shawty - 7/4/2008 9:16:12 AM
Post reply