Bindu

Bindu

  • NA
  • 40
  • 62.4k

how to make .ics file as downloadable

Aug 31 2012 1:34 AM
Hi..
 
For Exporting of .ics file i wrote the following code.
 

iCalendar iCal = new iCalendar();
foreach (DataRow row in dt.Rows)
{
// Create the event, and add it to the iCalendar
Event evt = iCal.Create();
 
// Set information about the event
evt.Start = (DDay.iCal.iCalDateTime)Convert.ToDateTime(row["StartDate"]);
evt.End = (DDay.iCal.iCalDateTime)Convert.ToDateTime(row["EndDate"]);// This also sets the duration
evt.Description = (string)row["Description"];
}
// Serialize (save) the iCalendar
iCalendarSerializer serializer = new iCalendarSerializer();
serializer.Serialize(iCal, @"C:\iCalendar.ics");
 
It is working fine for me but it writes file into C drive or as per the path we have given. but i need it to be downloadable.
 
i tried some code but it is not the exact format i needed.
 
Thanks in advance...

Answers (1)