I've been trying to create an iCal calendar in .NET that can be synced with other devices. I've been using DDay.iCal to generate iCal events from my data objects, and so far everything's working fine. From Outlook, I've subscribed to the calendar (Add Calendar » From Internet) by pointing to a URL that generates an ics file:
Response.Clear();
Response.ContentType = "text/calendar";
Response.AddHeader("Content-Disposition", "inline; filename=\"Calendar.ics\"");
Response.Write( GenerateCalendar() );
Response.End();
The events are properly imported into the calendar; however, in any Calendar software I've tried, I have been unable to update or delete events. It's not that there is an error in receiving the delete notification; it's simply that all clients recognize the calendar as read-only.
My idea is that by supplying URLs, I would be able to have Outlook or Google calendar contact my server in order to delete an event. Is my entire idea of how this is supposed to work wrong, or am I just missing out on the proper properties? (Or, perhaps, am I importing the calendar incorrectly, or distributing it incorrectly, as per the code above?)
A calendar generated by GenerateCalendar
above, may look something like this:
BEGIN:VCALENDAR
VERSION:2.0
METHOD:PUBLISH
PRODID:-//My Company//My App//EN
URL:http://localhost/test/
X-WR-CALNAME:Test
BEGIN:VEVENT
DTEND:20110831T100100
DTSTAMP:20111028T091109
DTSTART:20110831T090100
SEQUENCE:0
SUMMARY:Test
UID:1
URL:http://localhost/test/?id=1
END:VEVENT
END:VCALENDAR
My understanding is that you need to host your calendar on a CalDAV server (https://www.rfc-editor.org/rfc/rfc4791). Simply publishing a file (.ics) is different from hosting a calendar on a calendar engine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With