Hi!
My ASP.NET page gets a pdf-file from a SQLServer database and writes it in a browserwindow, using Response.BinaryWrite. It basically looks like this:
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e) { Byte myPdf = GetPdf; Response.Clear; Response.Buffer= true; Response.ContentType = "application/pdf"; Response.BinaryWrite(myPdf); Response.Flush; Response.End; }
private Byte GetPdf
{
//Code to get pdf from DB
}
//etc.
}
I noticed everytime I call the page, Page_Load is executed twice... Could someone explain this behaviour? How can I get rid of this?
Thanks!
My ASP.NET page gets a pdf-file from a SQLServer database and writes it in a browserwindow, using Response.BinaryWrite. It basically looks like this:
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e) { Byte myPdf = GetPdf; Response.Clear; Response.Buffer= true; Response.ContentType = "application/pdf"; Response.BinaryWrite(myPdf); Response.Flush; Response.End; }
private Byte GetPdf
{
//Code to get pdf from DB
}
//etc.
}
I noticed everytime I call the page, Page_Load is executed twice... Could someone explain this behaviour? How can I get rid of this?
Thanks!