mjoseph23
asked on
Does anyone know how to unload a pdf from a frame/webpage that is drawn by ceTe Dynamic PDF Merger?
I am experiencing some tricky session and frame behavior. I have a page A with a frame B in it. A session variable is passed from the main page A to the frame page B in order to display a pdf in the frame B. After the main page A is done passing the session variable to the frame page B I remove the variable from the session. When I leave the main page A and go back to the page C with the link to the main page A and then click a link to a second page D which is similar to page A. second main page D has a frame page E that is for some odd reason displaying the pdf from the first frame page B. I have tried everything
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
LoadPrimaryQapPDF();
}
}
protected void LoadPrimaryQapPDF()
{
string filepath = "";
if (!String.IsNullOrEmpty(Session["file"].ToString()))
{
filepath = Session["file"].ToString();
}
if (!String.IsNullOrEmpty(filepath))
{
//Create a PDF document
MergeDocument document = new MergeDocument(@filepath);
// Create a page and add it to the document
ceTe.DynamicPDF.Page page = new ceTe.DynamicPDF.Page();
document.Pages.Add(page);
// Outputs the document to the current web page
document.DrawToWeb();
Session.Remove("file");
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I must admit then that I am a loss. i would start by running some simple tests - What is session["file"] set to before you pass it from A, and when you receive it at B? Rather than using session, how about javascript? http://www.simiandesign.co m/blog-fu/ 2005/08/ja vascript_a cro.php Use that to pass the value across then initiate a postback of some sort (session variables are not, I have found, incredibly reliable - I prefer querystrings, post variables or viewstate where possible).
ASKER
Yes, the query string solved the problem. Thanks!
iframe1.Attributes["src"] = "QapAppointmentLetterPDFBo ttom.aspx? file=" + appendedfile;
iframe1.Attributes["src"] = "QapAppointmentLetterPDFBo
ASKER
Open in new window