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 » How To » How to call a postback from dynamically generated calendars

How to call a postback from dynamically generated calendars

I generate different calendars in runtime depending on the amount of employees on a table.
Is there a way i can do postback events on those generated calendars or i have to use JavaScript on them?
Rafael - 5/7/2008 11:53:43 PM
The actual problem is how do i know from which calendar(employee) is the selected free time from.
Rafael - 5/8/2008 12:26:22 AM
I think there should be no problem. If you generate a calendar dynamically, you also assign the event handler using something like

DayPilotCalendar1.TimeRangeSelected += new TimeRangeSelectedEventHandler(yourHandler);

Even if yourHandler method is the same for all calendar instances, you should always be able to detect it from sender parameter:
void yourHandler(object sender, TimeRangeSelectedEventArgs e)
{
DayPilotCalendar cal = (DayPilotCalendar) sender;
// your code here
}
Dan Letecky - 5/13/2008 5:27:33 PM
Post reply