views:

25

answers:

1

I want to include HTML and Eval within a Repeater:

<asp:Repeater ID="Rpt" runat="server" DataSourceID="DS">
    <HeaderTemplate><div id="gallery"></HeaderTemplate>
    <ItemTemplate>
        <a href='<%# Eval("Url") %>' class="show">  
            <img src='<%# Eval("Image") %>' alt='<%# Eval("Title") %>'
                title="" runat="server" id="sb1" rel='<%# Eval("Title") %>'/>
         </a>
     </ItemTemplate>
     <FooterTemplate></FooterTemplate>
</asp:Repeater>

I want the rel attribute Eval Title to have h3 tags wrapped around it. I've done this before, but I'm drawing a huge blank. My h3 tags look like this :( <h3>

A: 

First thing I noticed is you need to end the div tag in your FooterTemplate:

<FooterTemplate></div></FooterTemplate>

Then get rid of your runat="server" tag if you don't need it because it will cause the tags in the rel attribute to get encoded:

<ItemTemplate> 
    <a href='<%# Eval("Url") %>' class="show">   
        <img src='<%# Eval("Title") %>' alt='<%# Eval("Title") %>' 
            title="" id="sb1" rel='<h3><%# Eval("Title") %></h3>'/> 
    </a> 
</ItemTemplate>
Kelsey
i had to change the url but that worked...any idea why now my jquery image scroller displays the first image TWICE then starts scrolling properly having just been placed in this repeater?
Bry4n
Not sure but did you make sure to put the `</div>` tag in your footer?
Kelsey
Yeah that was just a typo. Damn I can't use a repeater if its going to eff up the slideshow..i guess ill post a different question. Thanks
Bry4n
It really shouldn't be the repeater as it just outputs the html you are providing in the template and that is all that the jQuery is looking at. There is something in the rendering or the jQuery slider that is incorrect.
Kelsey
Yeah I found out it was because of a class missing but needed to be added dynamically on the first item. ;)
Bry4n