Hi,
I am using a place holder control to create a formatted hyperlink and add it to a wizard page. Basically, users enter a bunch of information on the first page of the wizard and when they click Next, they can preview their response before submittiong. I can go to this page and hyperlink(s) are created and functional.
On the same preview page, I have a button that once clicked uses the javascript's Window.open to open a new window (this is a dynamicaaly generated PDF file opened in a new window). As soon as this window is opened, the content of the place holder (i.e the hyper links and text following it) disappears from the page. If I move the newly opened page to see what is on the preview page, or close it altogether, I can see that the placeholder control is gone. Why does this happen?
This is part of the event handler for the wizard's Next button that creates the hyperlinks:
for (int i = 0; i < dtAttachments.Rows.Count; i++) //dtAttachments is DataTable containing file information that user attached
{
sFileName = dtAttachments.Rows[i]["FileName"].ToString();
Literal ltlAtt = new Literal();
ltlAtt.Text =
"<span class=\"PageLink\"><a href=\"javascript:makeDownloadLink('" + sFileName + "', '" + DocType.SUPPORTING_DOC + "', '1')\">" + sFileName + "</a></span>";if (bSubmitting)
{
ltlAtt.Text +=
" --- Will be saved as " + fn + "_DM-xxxx-sa(" + (i + 1).ToString() + ")_" + DateTime.Today.ToString("yyyy-MM-dd") + System.IO.Path.GetExtension(dtAttachments.Rows[i]["Filename"].ToString());
}
ltlAtt.Text += "<br />";
phSuppDoc.Controls.Add(ltlAtt);
}
On the PageLoad():
if (!Page.IsPostBack)
{
Control container = (Control)wizSubmission.FindControl("FinishNavigationTemplateContainerID");
ImageButton ib = (ImageButton)container.FindControl("FinishPreviewPDFButton");
ib.Attributes[
"onClick"] = string.Format("window.open('Letter.aspx', 'SCLWin', 'toolbar=no,location=no,directory=no,resizable=yes,scrollbars=yes,status=no,width=800,height=800');");
}
Thanks.