Display data in ASP.Net Repeater as HTML Table format

Last Reply on Feb 12, 2018 01:00 AM By dharmendr

Posted on Feb 11, 2018 11:33 PM

ID        Item        Price

1          Book        25.00

2          pencil       10.00

3          rubber      3.00

I want get the value on rowindex number 2 Price value (3.00)  using eval in aspx.net

<asp:Repeater id="Repeater3" runat="server">
<ItemTemplate>
<HeaderTemplate>
 
<span class="profileLabel"><%# Eval("Price")%></span>
 
</HeaderTemplate></ItemTemplate>
</asp:Repeater>

and it shows like this

25.00 10.00 3.00

Posted on Feb 11, 2018 11:54 PM Modified on on Feb 11, 2018 11:54 PM

Will you please explain your requirement with more details and share your html and code.

 


Posted on Feb 12, 2018 01:00 AM

Use below html.

<asp:Repeater ID="Repeater3" runat="server">
    <HeaderTemplate>
        <table>
            <tr>
                Price
            </tr>
    </HeaderTemplate>
    <ItemTemplate>
        <tr>
            <td>
                <span class="profileLabel">
                    <%# Eval("Price")%></span>
            </td>
        </tr>
    </ItemTemplate>
    <FooterTemplate>
        </table>
    </FooterTemplate>
</asp:Repeater>