控制“TableBanks”;未实现 IPageableItemContainer
我将按如下方式使用 DataPager :
我有一个 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:
<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>
但发生了以下异常 Control 'TableBanks' does not Implement IPageableItemContainer 任何帮助将不胜感激。
我是 asp.net 新手
I'm gonna use DataPager as follows :
I have a HTML Table :
<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>
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>
But the following exception has occurred Control 'TableBanks' does not implement IPageableItemContainer
Any helps would be appreciated.
I'm a newbie in asp.net
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在这里找到了答案 http://www.codeproject .com/Questions/105933/Using-DataPager-for-Datalist.aspx:
您不能将 DataPager 与 DataList 一起使用,因为错误表明 DataList 控件未实现 IPageableItemContainer。
您可以使用 ListView 控件代替 DataList。
或
使用 DataList 检查高效数据分页 http://weblogs.asp .net/scottgu/archive/2006/01/07/434787.aspx
I've found the answer here http://www.codeproject.com/Questions/105933/Using-DataPager-for-Datalist.aspx :
You cannot use DataPager along with DataList as the error says DataList control does not implements IPageableItemContainer.
You can use ListView control instead of DataList.
or
Check Efficient Data Paging with DataList http://weblogs.asp.net/scottgu/archive/2006/01/07/434787.aspx