How to generate an iCalendar file (ASP.NET/C#)
It is fairly simple to generate an iCalendar file (for calendar clients like Microsoft Outlook or Mozilla Sunbird ) as it is just a plain text file with the extension 'ics'. A WebHandler is the best method of doing this. Update (10 Feb 2006) : Now works in Sunbird. When prompted to open / save the file, choose to download. Then in Sunbird, go to File > Import and browse for the saved file. iCalendar.ashx <%@ WebHandler Language="C#" Class="MyNamespace.iCalendar" %> using System; using System.Web; namespace MyNamespace { public class iCalendar: IHttpHandler { public bool IsReusable { get { return true; } } string DateFormat { get { return "yyyyMMddTHHmmssZ"; // 20060215T092000Z } } public void ProcessRequest(HttpContext ctx) { DateTime startDate = DateTime.Now.AddDays(5); DateTime endDate = startDate.AddMinutes(35); string organizer = "foo@bar.com"; string...