Databind and trying to get index in Listview
<p>Need a hand trying to get my rotating banner working properly on my website. I'm using the jquery cycle plugin which manages the rotation. Within my CMS I've got something called a smartform, which contains upto 6 pictures. The code below (something which I wrote by following a tutorial for the banner) works really well. However I would like to somehow get the index of the image and place it within the alt tags. What I am trying to achieve is the alt tag to say "Banner_(ImageIndexNumber)".</p>

<p>Hopefully someone can help, thanks all</p>

<p>C# Codebehind</p>

<pre><code>private void BannerFill(int contentId)
{
    try
    {
        uxBannerContentBlock.DefaultContentID = contentId;
        uxBannerContentBlock.Fill();
        string xml = uxBannerContentBlock.EkItem.Html;

        SmartForm.RotatingBanner.BannerImage bannerGroup = (SmartForm.RotatingBanner.BannerImage)
        Ektron.Cms.EkXml.Deserialize(typeof(SmartForm.RotatingBanner.BannerImage), xml);

        List&lt;BannerSlide&gt; slides = GetBannerSlides(bannerGroup.Slides);

        //Databind//

        uxBannerRepeater.DataSource = slides;
        uxBannerRepeater.DataBind();
    }
    catch { }
}

protected List&lt;BannerSlide&gt;
    GetBannerSlides(SmartForm.RotatingBanner.BannerImageSlides[] bannerGroupSlides)
{
    List&lt;BannerSlide&gt; bSlides = new List&lt;BannerSlide&gt;();

    foreach (SmartForm.RotatingBanner.BannerImageSlides bgSlide in bannerGroupSlides)
    {

        bSlides.Add(new BannerSlide(bgSlide.Image.img.src));
    }

    return bSlides;
}


public class BannerSlide
{
    //properties//
    public string SlideImage { get; set; }

    //constructor//
    public BannerSlide(string slideImage)
    {
        SlideImage = slideImage;
    }
}
</code></pre>

<p>Front end</p>

<pre><code>&lt;div class="slideshow"&gt;
&lt;CMS:ContentBlock ID="uxBannerContentBlock" runat="server" Visible="false" /&gt;
    &lt;asp:Repeater runat="server" ID="uxBannerRepeater"&gt;
        &lt;ItemTemplate&gt;
            &lt;img src="&lt;%# DataBinder.Eval( Container.DataItem,"SlideImage")  %&gt;" alt="Banner_&lt;%# Container.ItemIndex %&gt;" /&gt;
        &lt;/ItemTemplate&gt;
    &lt;/asp:Repeater&gt;
</code></pre>

<p></p>
