protected void btnDownload_Click(object sender, EventArgs e) { Stream outputStream = ExecuteMerge("all", DocumentFormat.Rtf); outputStream.Seek(0, SeekOrigin.Begin); StreamCopyHelper.Copy(outputStream, Response.OutputStream); Response.StatusCode = (int)HttpStatusCode.OK; Response.ContentType = "application/rtf"; Response.AddHeader("Content-Disposition", "attachment; filename=RichEditMailMerge.rtf"); Response.End(); }
private void RefreshPreview(string previewName) { Response.StatusCode = (int)HttpStatusCode.OK; Response.ContentType = "text/html"; Stream outputStream = ExecuteMerge(previewName, DocumentFormat.Html); outputStream.Seek(0, SeekOrigin.Begin); StreamCopyHelper.Copy(outputStream, Response.OutputStream); Response.End(); }