开发者

how can i use datapager with datalist?

i have a datalist and a datapager but when i run my program it have error.

Control 'DataList1' does not implement IPageableItemContainer.

what is problem?

    <asp:DataList ID="DataList1" runat="server" DataKeyField="id" 
        DataSourceID="SqlDataSource1">
        <ItemTemplate>
            id:
            <asp:Label ID="idLabel" runat="server" Text='<%# Eval("id") %>' />
            <br />
            name:
            <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
            <br />
            tedad:
            <asp:Label ID="tedadLabel" runat="server" Text='<%# Eval("tedad") %>' />
            <br />
            group_id:
            <asp:Label ID="group_idLabel" runat="server" Text='<%# Eval("group_id") %>' />
            <br />
            VDate:
            <asp:Label ID="VDateLabel" runat="server" Text='<%# Eval("VDate") %>' />
            <br />
            KDate:
            <asp:Label ID="KDateLabel" runat="server" Text='<%# Eval("KDate") %>' />
            <br />
            gheimat:
            <asp:Label ID="gheimatLabel" runat="server" Text='<%# Eval("gheimat") %>' />
            <br />
            details:
            <asp:Label ID="detailsLabel" runat="server" Text='<%# Eval("details") %>' />
            <br />
            imgae:
            <asp:Label ID="imgaeLabel" runat="server" Text='<%# Eval("imgae") %>' />
            <br />

" SelectCommand="SELECT * FROM [Tbl_Kala_Group_No]">

    <asp:DataPager ID="DataPager1" runat="开发者_C百科server" PagedControlID = "DataList1" PageSize = "4"  QueryStringField = "page" >

        <Fields>

            <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                ShowLastPageButton="True" />
        </Fields>
    </asp:DataPager>


Datapager control does not support for DataList. it works with ListView.

so, Paging for DataList, you have create paging dynamically.

Just give in google : paging for Datalist, you will find lots of resource. Thank you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜