title: Sending ICalendar event to client while still continue running your code
body: <p>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.</p>
  
  <p>Basically, my application works like this.</p>
  
  <ol>
  <li>A User logs in.</li>
  <li>Selects a specific date.</li>
  <li>Books a specific timeslot</li>
  <li>Clicks the "Add to calendar" link</li>
  </ol>
  
  <p>Sending the event is done by using <code>Response.Write()</code> which sends the following to the client:</p>
  
  <pre><code>Response.ContentType = "text/calendar";
  Response.AddHeader("Content-disposition", "attachment; filename=appointment.ics");
  Response.Write(iCalString);
  </code></pre>
  
  <p>The above works fins but it requires me to first book the event then manually and then click the "Add to calendar" link.</p>
  
  <p>I want to merge the steps 3 and 4. But when trying to do so the event booking gets saved to the database but the screen does not get refreshed.</p>
  
  <p>Is there a "simple" way to get around this?</p>