Placeholder content disppears

Last post 07-04-2009 11:15 AM by Segundo. 2 replies.

Sort Posts:

  • Placeholder content disppears

    04-28-2009, 5:01 PM
    • Participant
      844 point Participant
    • NoBullMan
    • Member since 06-28-2006, 5:27 PM
    • Virginia
    • Posts 552

    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.

  • Re: Placeholder content disppears

    07-04-2009, 8:44 AM
    • Member
      549 point Member
    • adeelehsan
    • Member since 07-18-2005, 10:56 AM
    • UAE
    • Posts 94

    Hello

    It is always recommended not to place anything inside the content place holder of the master page which you want to show without the content page customization. You can put the controls outside the content place holder so it will not be affected by the content page.

    Please Mark AS Answer if it helped.
    Regards
    ADEEL EHSAN
  • Re: Placeholder content disppears

    07-04-2009, 11:15 AM
    • Contributor
      4,934 point Contributor
    • Segundo
    • Member since 09-07-2006, 10:44 AM
    • Lima, Perú
    • Posts 693

    Hi,

    If you want to show the content of the contentplaceholder of the master page in the content page.... then you must quit the corresponding content zone in the content page.

    Any doubt, post your comment.


Page 1 of 1 (3 items)