Glossary Item Box

AspLib Rotator Send comments on this topic.

Define a slide template

To use design-time template editing

 

Defining a Slide Template

 

A slide template is an area of HTML markup that you include inside a Rotator control to change the appearance of the rotating data and its container. The template can include other controls, text, and HTML markup.

An HTML table is often used inside a rotator to hold data items in position. The following template example has two rows that display the news feed.

The following slide template code inserts an HTML <table> tag inside the Rotator's element. The table has some rows that hold data. The first cell of the first table row contains the arrow image and the title text from the data source. The second cell of the first row holds the date portion of the news feed. The second table row has only one cell which displays the news or "Text" part of the news item.


Example:

<SlideTemplate>

<table border="0" cellpadding="0" cellspacing="2" style="height: 80px;" width="100%">

<tr>

<td class="NewsText">

<img alt="" height="8" src="images/arrow.gif" style="border: none;" width="11" />

<span class="NewsTitle">

<%# DataBinder.Eval(Container.DataItem, "Title") %>

</span>

</td>

<td align="right" class="NewsDate">

<%# DataBinder.Eval(Container.DataItem, "Date") %>

</td>

</tr>

<tr>

<td class="NewsText" colspan="2" valign="top">

<%# DataBinder.Eval(Container.DataItem, "Text") %>

</td>

</tr>

</table>

</SlideTemplate>

 

You can edit the SlideTemplate in design view by right-clicking on the Rotator control.

 

 


© 2002-2006 Astron Digital. All Rights Reserved.