The ASPX file below will render the Composite page with the Friendly URL [ "hostname", "path" ]. If no such Composite page exists, a 404 message will be written to the client, and the RenderPage methods exits with an exception.
<%@ Page Language="c#" AutoEventWireup="true" AspCompat="true"%> <%@ Assembly name="Composite.Cms.Pub.PageRender, Version=3.1.1117.310, Culture=neutral, PublicKeyToken=b5e57ccb698eab8e" %> <%@ Import Namespace="Composite.Cms.Pub.PageRender" %>
<script language="C#" runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
PageBuilder PB = new PageBuilder( this );
try
{
PB.RenderPage( "hostname" , "path" );
}
catch( Exception ex )
{
if( "page not found" != ex.Message )
throw ex;
}
}
</script>