Thursday, April 26, 2012

Get the List of calendar events in ektron cms

The ektron calendar provides an easy ways to site admin to add,edit and update the events for calendar year or more.Here i will show how to get the calendar events list to list view.Using Web calendar API ,i will send the calendar id ,start date and end date as input parameters to get the list items between data range.Here the method Getlist() which will give the list of calendar events
 Ektron.Cms.Controls.Calendar c = new Ektron.Cms.Controls.Calendar();
 WebEventManager wManager = new WebEventManager();
 //calendar id in Workarea
 long calId = 1654;
 String st = DateTime.Now.ToString();//cuurent date
 String et = "31-04-2012 17:30:00";
 DateTime startdate= DateTime.Parse(st);
 DateTime enddate = DateTime.Parse(et);
 List webeventcalendarList = wManager.GetList(calId,startdate,enddate);
 if (webeventcalendarList != null)
list_events.DataSource = webeventcalendarList;
Response.Write("There is no list of events");
Post a Comment