控件“ TableBanks”未实现IPageableItemContainer [英] Control 'TableBanks' does not implement IPageableItemContainer
问题描述
我将按以下方式使用DataPager:
I'm gonna use DataPager as follows :
我有HTML表格:
<table id="TableBanks" runat="server" border="0" align="center" style="width: 93%"
cellpadding="3" cellspacing="1">
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td> MerchantID </td>
<td><asp:TextBox ID="TextBoxMerchantID" runat="server" CssClass="textbox" MaxLength="50"></asp:TextBox></td>
</tr>
<tr>
<td> TerminalID </td>
<td><asp:TextBox ID="TextBoxTerminalID" runat="server" CssClass="textbox" MaxLength="50"></asp:TextBox></td>
</tr>
<tr>
<td> TransactionKey </td>
<td><asp:TextBox ID="TextBoxTransactionKey" runat="server" CssClass="textbox" MaxLength="50"></asp:TextBox></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"><asp:Label ID="LabelResult" runat="server" Style="color: Gray;"></asp:Label></td>
</tr>
</table>
现在我想在DataPager中使用它,我的意思是我想让dataPager重复它。
这是我的DataPager:
Now I wanna use it in DataPager, I mean I want dataPager repeat it.
this is my DataPager:
<asp:DataPager ID="DataPager1" runat="server" PagedControlID="TableBanks">
<Fields>
<asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="True" ShowNextPageButton="False"
ShowPreviousPageButton="True" FirstPageText="<<" LastPageText=">>" NextPageText=">"
PreviousPageText="<" RenderDisabledButtonsAsLabels="false" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField ButtonType="Link" ShowLastPageButton="True" ShowNextPageButton="True"
ShowPreviousPageButton="False" RenderDisabledButtonsAsLabels="false" NextPageText=">"
LastPageText=">>" />
</Fields>
</asp:DataPager>
但是发生了以下异常控件 TableBanks未实现IPageableItemContainer
任何帮助将不胜感激。
我是asp.net的新手
But the following exception has occurred Control 'TableBanks' does not implement IPageableItemContainer
Any helps would be appreciated.
I'm a newbie in asp.net
推荐答案
我在这里找到了答案 http://www.codeproject.com/Questions/105933/Using-DataPager-for-Datalist.aspx :
您不能同时使用DataPager带有DataList,因为错误表明DataList控件未实现IPageableItemContainer。
You cannot use DataPager along with DataList as the error says DataList control does not implements IPageableItemContainer.
您可以使用ListView控件代替DataList。
You can use ListView control instead of DataList.
or
使用DataList检查有效的数据分页 http://weblogs.asp.net/scottgu/archive/2006/01/07/434787.aspx
Check Efficient Data Paging with DataList http://weblogs.asp.net/scottgu/archive/2006/01/07/434787.aspx
这篇关于控件“ TableBanks”未实现IPageableItemContainer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!