views:

28

answers:

1

Hi everyone, i have built a basic calendar event using DDay.iCal, when I click "Add to calendar" link I produce an event and then sends this to the client.

I basic my application works like this.

  1. A User logs in.
  2. Selects a specific date.
  3. Books a specific timeslot
  4. Clicks the "Add to calendar" link

Sending the event is done by using Responce.Write() which sends the folowing to the client: Response.ContentType = "text/calendar"; Response.AddHeader("Content-disposition", "attachment; filename=appointment.ics"); Responce.Write(iCalString);

The above works fins but it requires me to first book the event then manually and then click the "Add to calendar" link.

I want to merge the steps 3 and 4. But when trying to do so the event bookig gets saved to the database but the screen does not get refreshed.

Is there a "simple" way to get around this?

Thank you!

/Magnus

A: 

You need to set up a simple HttpHandler to post the reply and then do a Response.Redirect() into it.

I have done similar work before with integrating the vcard format into an our people section of a website. These articles should tell you everything you need to set up the HttpHandler - just replace the vcard code with your ical code.

When you redirect into the ical handler it will just instantly pop up the download box, you wont be taken to an empty page, the user is left on the same page.

rtpHarry