<xmod:Template>

The template tag is the primary workhorse of XModPro. It contains the data commands and layout instructions for your display. Additionally, it enables you to specify who is allowed to add, edit, and delete records as well as who is allowed to view the details of records. You can use multiple Template tags, enabling you to have side-by-side (or however you want to lay them out using HTML) displays within the same module instance, each being fed by different datasources.

Syntax

<xmod:template
    AddRoles="DNNRoleName1,DNNRoleName2"
    Ajax="True|False"
    ConnectionString="string"
    DeleteRoles="DNNRoleName1;DNNRoleName2"
    DetailRoles="DNNRoleName1;DNNRoleName2"
    EditRoles="DNNRoleName1;DNNRoleName2"
    ID="string"
    UsePaging="True|False">


    <ListDataSource CommandText="string"
        ConnectionString="string"/>

    <DetailDataSource CommandText="string"
        ConnectionString="string"/>

    <DeleteCommand CommandText="string" />

    <CustomCommands>
      <DataCommand CommandName="string" CommandText="string" ConnectionString="string">
        <Parameter Name="string" Value="string" />
      </DataCommand>
    </CustomCommands>


    <Pager> ... </Pager>
    <SearchSort>...</SearchSort>


    <HeaderTemplate>...</HeaderTemplate>
    <ItemTemplate>...</ItemTemplate>
    <AlternatingItemTemplate>...</AlternatingItemTemplate>
    <SeparatorTemplate>...</SeparatorTemplate>

    <FooterTemplate>...</FooterTemplate>

    <DetailTemplate>...</DetailTemplate>

    <NoItemsTemplate>...</NoItemsTemplate>

</xmod:template>

Remarks

Back to top

Example

<xmod:template addroles="SampleRole1;SampleRole2">
    <ListDataSource commandtext="SELECT * FROM Users" />
    <DetailDataSource commandtext="SELECT * FROM Users WHERE UserID=@UserID" />
    <HeaderTemplate>
        <ul>
    </HeaderTemplate>
    <ItemTemplate>
        <li>
            User's Name: [[FirstName]] [[LastName]] <br />
            <xmod:detaillink text="More...">
                <parameter name="UserID" value='[[UserID]]' />
            </xmod:detaillink>
        </li>
    </ItemTemplate>
    <AlternatingItemTemplate>
        <li class="AltItem">
            User's Name: [[FirstName]] [[LastName]] <br />
            <xmod:detaillink text="More...">
                <parameter name="UserID" value='[[UserID]]' />
            </xmod:detaillink>
        </li>
    </AlternatingItemTemplate>
    <FooterTemplate>
        </ul>
    </FooterTemplate>
    <DetailTemplate>
        <h1>This is the detail view</h1>
        User's Name: [[FirstName]] [[LastName]]
    </DetailTemplate>
</xmod:template>
Back to top