Show navigation | Frontpage | Contact us | Sitemap

ShowPageByFriendlyUrl.aspx sample

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>

My modules


© 2008 Composite A/S, Danmark
Tlf: +45 39 15 76 00 | info@composite.net
Composite A/S er Microsoft Certified Partner
Composite CMS overholder standarden for valid CSS
Composite CMS overholder standarden for valid XHTML 1.0
Printet fra http://www.composite.net/composite-1558.htm
Findes på denne sti: Composite Developer | 3.x technologies | ASP.NET | Composite .Net API | ShowPageByFriendlyUrl.aspx