how to make .ics file as downloadable

Posted by kbm5evm-16703 under ASP.NET on 8/31/2012 | Points: 10 | Views : 2586 | Status : [Member] | Replies : 0

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...


(No response found.)

Login to post response