Content is still under development. For additional information please consult our community forums, knowledgebase or contact us.

Contents

Documentation

The InstantForum.NET Master Page


Each skin within InstantForum.NET contains a standard ASP.NET master page file allowing you to easily wrap existing rich templates around InstantForum.NET.

 

The master page file can be found within the root of each InstantForum.NET skin directory. Each skin can have a different masterpage template. For example if you wanted to wrap an existing web site design around our "Classic" skin you would navigate to "\Skins\Classic\MasterPage.Master"

 

Open this within Visual Studio.NET (or NotePad) and you should see the following template…

 

Understanding the MasterPage.Master File

 

The masterpage.master file is a tempalte you can use to add your web sites header & footer HTML around InstantForum.NET. The default master mark-up looks like this…

<%@ Master Language="VB" Inherits="InstantASP.InstantForum.UI.Controls.Master" EnableViewState="false" %>
<#%@ Register tagPrefix="InstantASP" Namespace="InstantASP.Common.UI.WebControls" Assembly="InstantASP.Common.UI" %>
<%@ Register tagPrefix="InstantForum" Namespace="InstantASP.InstantForum.UI.Controls" Assembly="InstantASP.InstantForum.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="ctlHeader" runat="server">
    <title></title>
</head>
<body>
<form id="form1" runat="server">
    <div class="contentWrapper">
        <div class="contentPadding">
            <InstantASP:Literal ID="lblWrapperHeader" runat="server" />
            <asp:contentplaceholder id="ctlContentPlaceHolder" runat="server"/>
            <InstantASP:Literal ID="lblWrapperFooter" runat="server" />
        </div>
     </div> 
</form>
</body>
</html>

 To assist we've detailed each key line below…

<InstantASP:Literal ID="lblWrapperHeader" runat="server" />
If you provide a wrapper within the Admin CP the wrapper HTML header code will be rendered by this label.

<asp:contentplaceholder id="ctlContentPlaceHolder" runat="server"/>
This content placeholder is the location all forum mark-up will e added.

<InstantASP:Literal ID="lblWrapperFooter" runat="server" />
If you provide a wrapper within the Admin CP the wrapper HTML footer code will be rendered by this label.

Wrapping your design around the forum

To wrap your existing HTML around InstantForum.NET you should add your header HTML just before the    <InstantASP:Literal ID="lblWrapperHeader" runat="server" /> control and your footer HTML just after the the   <InstantASP:Literal ID="lblWrapperFooter" runat="server" />  label control.

For example…

<%@ Master Language="VB" Inherits="InstantASP.InstantForum.UI.Controls.Master" EnableViewState="false" %>
<#%@ Register tagPrefix="InstantASP" Namespace="InstantASP.Common.UI.WebControls" Assembly="InstantASP.Common.UI" %>
<%@ Register tagPrefix="InstantForum" Namespace="InstantASP.InstantForum.UI.Controls" Assembly="InstantASP.InstantForum.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="ctlHeader" runat="server">
    <title></title>
</head>
<body>
<form id="form1" runat="server">
    <div class="contentWrapper">
        <div class="contentPadding">
            <table width="500">
            <tr>
            <td>
            <InstantASP:Literal ID="lblWrapperHeader" runat="server" />
            <asp:contentplaceholder id="ctlContentPlaceHolder" runat="server"/>
            <InstantASP:Literal ID="lblWrapperFooter" runat="server" />
            </td>
            </tr>
            </table>
        </div>
     </div> 
</form>
</body>
</html>

If your header or footer HTML contains links to images or other pages on your main web site you will need to ensure you provide absolute URLs for your hyperlinks within the InstantForum.NET masterpage to ensure your links still work. For example an image maybe <img src="http://yourdomain.com/images/companylogo.gif" />.

If you use relative URLs for your links or images and InstantForum.NET is installed within a child folder off your main web site you can use relative links providing you use the correct paths within the masterpage. For example an image maybe <img src="../images/companylogo.gif" />.

This would link to an image in your "Images" folder on your main web site.

Using rich server side controls within the MasterPage

 

As this is a standard ASP.NET master page you can include 3rd party UI controls such as JavaScript based navigation controls. Or standard ASP.NET server controls such as the ASP.NET membership controls.

For example lets say you would like to add ASP.NET user controls to render the forum header & footer you can include user controls like so...

<%@ Master Language="VB" Inherits="InstantASP.InstantForum.UI.Controls.Master" EnableViewState="false" %>
<#%@ Register tagPrefix="InstantASP" Namespace="InstantASP.Common.UI.WebControls" Assembly="InstantASP.Common.UI" %>
<%@ Register tagPrefix="InstantForum" Namespace="InstantASP.InstantForum.UI.Controls" Assembly="InstantASP.InstantForum.UI" %>
<% @Register tagprefix="InstantASP" Tagname="Header" src="instantaspascx/iaspheader.ascx" %>
<% @Register tagprefix="InstantASP" Tagname="Footer" src="instantaspascx/iaspfooter.ascx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="ctlHeader" runat="server">
    <title></title>
</head>
<body>
<form id="form1" runat="server">
    <div class="contentWrapper">
        <div class="contentPadding">
            <InstantASP:Header runat="server"/>
            <InstantASP:Literal ID="lblWrapperHeader" runat="server" />
            <asp:contentplaceholder id="ctlContentPlaceHolder" runat="server"/>
            <InstantASP:Literal ID="lblWrapperFooter" runat="server" />
            <InstantASP:Footer runat="server"/>
        </div>
     </div> 
</form>
</body>
</html>

 Using Inline Code within the MasterPage

You can use inline ASP.NET code within your MasterPage. For example if you wanted perform a redirect within our software you could use the masterpage.master file to add code as shown below..



As the masterpage is used for every page this code will be executed on all front-end pages.

Adding inline code within the MasterPage.Master avoids the need to recompile the solution.

The InstantForum.NET Admin CP Master Page

We use a separate masterpage for the InstantForum.NET Admin Area.  This masterpage can be found within the root of each skin directory and is called "Admin.Master".




© 2010 InstantASP Ltd. All Rights Reserved. Powered by InstantKB.NET 2010 Alpha (Doc Skin)