Limit asp:Repeater control - Is it possible without changing sql statement?

Posted by ktsixit on Stack Overflow See other posts from Stack Overflow or by ktsixit
Published on 2011-01-17T14:42:26Z Indexed on 2011/01/17 14:53 UTC
Read the original article Hit count: 151

Filed under:
|
|
|
|

Hi all,

I'm trying to apply some kind of limit on an asp:Repeater control, so that I can get only the first 5 results from repeating.

The only suggested solution I have found is about limiting the sql statement results. In my case, this is not possible.

I need to find some other kind of solution. Are there any other asp controls that I could use which are similar to Repeater?

This is the current code I'm using:

<asp:Repeater ID="rptrMan" runat="server" OnItemDataBound="rptrMan_ItemDataBound" EnableViewState="false">
        <HeaderTemplate>
            <ul>
        </HeaderTemplate>
        <ItemTemplate>
            <li>
                <div class="picture1">
                    <asp:HyperLink ID="imageLink" runat="server" />
                </div>
                <div class="title">
                    <asp:HyperLink ID="manTitle" runat="server" />
                </div>
            </li>
        </ItemTemplate>
        <FooterTemplate>
            </ul>
        </FooterTemplate>
    </asp:Repeater>

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET