在页面上,我通过将 PostBackUrl 设置为单击打开链接按钮上的附件
lnkCalendar.PostBackUrl = "AddScheduleToCalendar.aspx?scheduleGuid=" + scheduleGuid;
保存或关闭附件后,当前打开的网页按钮单击仍会再次打开相同的附件,但它们自己的单击事件不起作用。如果直到不单击附件链接按钮事件有效。AddScheduleToCalendar.aspx 页面加载方法的attachmnet 代码为
string calendarFormat = GetScheduleInfo();
Response.ContentType = "text/calendar";
Response.AppendHeader("content-disposition", "attachment; filename=MyCalendar.ics");
Response.Write(calendarFormat);
Response.End();