thanks for your reply.
it works, in this context.
But my problem is a bit more complicated : the page displaying PDFs is a generic one :
pgPdfVisu.aspx :
Code:
protected void Page_Load(object sender, EventArgs e)
{
if Session["pdf"] == null)
{
throw new HttpException (404, "Document inexistant");
}
else
{
PdfDocument pdf = (PdfDocument)Session["pdf"];
// Envoi du pdf au navigateur
MemoryStream sortie = new MemoryStream();
pdf.Save(sortie, false);
Response.Clear();
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", sortie.Length.ToString());
Response.BinaryWrite(sortie.ToArray());
Response.Flush();
sortie.Close();
Response.End();
}
and pdf are generated (and saved) in several other aspx pages.
eg :
Code:
...
PdfDocument pdf = ed.devis_generePDF(true);
Session["pdf"] = pdf;
// I try to save to disk here
ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "editLoad", "var pdf_p=window.open('pgPdfVisu.aspx', 'pdf'); setTimeout(function(){ if(!pdf_p){ window.alert('Un anti-pop-up a empéché d ouvrir le devis');}}, 500);", true);