将分页添加到datalist

时间:2014-03-18 16:05:35

标签: asp.net datalist

如何向我的datalist添加分页功能,我在asp.net中创建它并使用sqldatasource填充datalist。请参阅以下代码: -

<asp:DataList OnSelectedIndexChanged="SelectedIndexChanged" ID="DataList2" 
        runat="server" DataSourceID="SqlDataSource1" 
        RepeatColumns="3" CellSpacing="10" Font-Bold="False" Font-Italic="False" 
        Font-Names="Arial" Font-Overline="False" Font-Size="Medium" 
        Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" 
        ShowFooter="False" ShowHeader="False">
        <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
            Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" 
            VerticalAlign="Middle" />
        <ItemTemplate>
            <asp:Image runat="server" Width="120" Height="140" ID="Image1" ImageUrl='<%# Eval("Cover_img") %>' />
            <br />
                <asp:Label ID="platform" runat="server" Text='<%# Eval("Platform") %>' />
            <br />
               <asp:Label runat="server" Text='<%# Eval("Name") %>' id="lblgame"/>
            <br />

    <asp:Button CommandName="Select" runat="server" Text="Want it" id="btnBuy"></asp:Button>
</ItemTemplate>
        <SelectedItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False" 
            Font-Strikeout="False" Font-Underline="False" HorizontalAlign="Center" 
            VerticalAlign="Middle" /> </asp:DataList>

0 个答案:

没有答案