EndPreviousNextEnd EndPrint This TopicEnd

Printpage.ascx

A default Printing page is used when a website viewer clicks the “Print” button that appears at the bottom of a Content Module, when it is enabled in the “Features” of that page.

 

A default printpage.ascx file has already been created for you to use and is found in the Templates folder. This file is essentially the same as any other template file, except that it has only one container to hold a Content Module.

 

When you address the design of this page, please note the following:
 

1.The design must be very simple and use very little layout

 

2.Any images must have the following prefix /Templates/_images

 

3.Save files in the Templates Folder as - printpage.ascx

 

4.Print Page templates need to be created for each site.

 

 

Default Code

 

<%@ Control %>

<%@ Register TagPrefix="contegro" TagName="PrintPageContainer" Src="~/UserControls/Base/PrintPageContainer.ascx" %>

<script language="C#" runat="server">

//Script required to get application path of site for resolving source paths for images, scripts and stylesheets.

public string SitePath = string.Empty;

void Page_Load(object sender, System.EventArgs e) {if (Page.ResolveUrl("~")!="/"){SitePath = Page.ResolveUrl("~");}else{SitePath = "";}}

</script>

 

<div style="position:absolute;width:100%;">

<img src="<%=SitePath%>/Templates/_images/Logo.gif" alt="Contegro" style="display:block; border:none" />

  <div id="cPC">

    <contegro:PrintPageContainer id="cPC" runat="server"></contegro:PrintPageContainer>

  </div>

  <a href="#" onclick="window.print();return false;"><img src="<%=SitePath%>/Templates/_images/button_print.gif" border="0" alt="Print" /></a>

  <a href="#" onclick="window.close();return false;"><img src="<%=SitePath%>/Templates/_images/button_cancel.gif" border="0" alt="Cancel" /></a>

</div>

</div>

 

Topic Link