ASP.NET Integration

The Smartsite iXperion Publication Server is built from the ground up as a .Net application that can be hosted inside an ASP.Net environment.

As you would probably guess, Smartsite requests are handled using an HttpHandler registered in the web.config. HttpHandlers are responsible for the complete handling of the request-response pipeline.

ASP.Net web pages (mainly .aspx files) are handled using a different HttpHandler, mostly defined as a default in the machine.config.

Now, let's talk about the options you have when it comes to integrating both technologies.

Referencing the iXperion Publication Server from ASP.Net WebPages

You can reference the Smartsite CMS in your ASP.Net code, using the static property Smartsite.Core.Site.Current. The full Publication Server object model can thus be accessed. Also, a CmsPage class exists that maps a Smartsite CMS item directly to your web form, using unique IDs for contenttype databinding.

Define ASP.NET master pages in Smartsite

Have a look at the ASP.NET page below. Specifically, look at the MasterPageFile attribute. It points to a CMS item, aspnetmaster, which is rendered in the DEF channel using the Smartsite Virtual Path Provider.

HTML CopyCode image Copy Code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="/members/Login.aspx.cs" 
  Inherits="Members_Login" MasterPageFile="/cmsvp/def/aspnetmaster.master" %>
<asp:Content runat="server" ContentPlaceHolderID="BodyPlaceholder">
   <h2>Forms Authentication</h2>
 
   <h3>Login</h3>
   <asp:Login ID="ctrlLogin" runat="server"></asp:Login>
        
   <h3>Password Recovery</h3>
   <asp:PasswordRecovery ID="ctrlPasswordRecovery" runat="server" ></asp:PasswordRecovery>        
</asp:Content>

Any type of data can thus be stored in the CMS and processed by any other ASP.Net handler, making this a very powerful feature. You can thus store your Master Pages in Smartsite, taking advantage of all the power of SXML Site Building.

Use CMS Native ASP.NET pages (NAP)

You can convert any Smartsite web page to a Native ASP.NET page just by setting the file type to .aspx (or another ASP.NET filetype).

SXML ASP.Net WebControl

Smartsite comes with an ASP.Net webControl that allows for rendering SXML directly from your ASP.Net pages. For example, in the following web page, a sitemap macro is executed using the Smartsite SXML processor:

HTML CopyCode image Copy Code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="iXperionSite.WebForm3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:se="http://smartsite.nl/namespaces/sxml/1.0">
<head runat="server">
    <title>My Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <div class="menubar">
           <cms:region runat="server">
             <se:xlinks parent="mymenufolder" />
          </cms:region> 
        </div>
    </form>
</body>
</html>

Topics