Databinding manually in Relatude

Doing databinding manually means that you are responsible for setting the datasource and calling databind on the databound controls at the correct time.

About this example

In the example code below, all nodes inheriting from HierarchicalCOntent are printed in a list using a Repeater. The Repeater is just one of the many databound controls that ships with ASP.NET. Other databound controls are for example: GridView, DetailsView, ListView and DataList. A lot of 3rd party controls are also databound controls that you can work with in the same way we show below:

    <asp:Repeater runat="server" ID="repNodeList">
        <ItemTemplate>
            <%# Eval("Name") %><br />
        </ItemTemplate>
    </asp:Repeater>

The code below uses AqlContentsQuery to fetch the data that is bound to the repeater. You can equally use LINQ or standard AQL queries to do the same query.

repNodeList.DataSource = WAFContext.Session.GetContents<HierarchicalContent>();
repNodeList.DataBind();