Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/30.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net ListView数据寻呼机不工作_Asp.net_Listview_Datapager - Fatal编程技术网

Asp.net ListView数据寻呼机不工作

Asp.net ListView数据寻呼机不工作,asp.net,listview,datapager,Asp.net,Listview,Datapager,我有一个带有数据寻呼机的列表视图 <asp:ListView ID="ProfilesList" runat="server" OnItemDataBound="ProfilesList_DataBound" > <LayoutTemplate> <asp:DataPager runat="server" ID="ContactsDataPager" PageSize="12">

我有一个带有数据寻呼机的列表视图

<asp:ListView ID="ProfilesList" runat="server" OnItemDataBound="ProfilesList_DataBound" >
               <LayoutTemplate>
                   <asp:DataPager runat="server" ID="ContactsDataPager" PageSize="12">
            <Fields>
              <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowLastPageButton="true"
                FirstPageText="|&lt;&lt; " LastPageText=" &gt;&gt;|"
                NextPageText=" &gt; " PreviousPageText=" &lt; " />
            </Fields>
          </asp:DataPager>
              <table cellpadding="0" cellspacing="0" class="GridBody" style="padding:0; width:910px; border-bottom-style:none;">
                    <tr class="GridHeader" style="text-align:center;">
                        <td style="width:8px; padding-left:5px; border-bottom-style:none; ">
                        </td>
                        <td style="width:274px; border-bottom-style:none;">
                            Person Info
                        </td>
                        <td style="width:273px; border-bottom-style:none;">
                            Company Info
                        </td>
                        <td style="width:272px; border-bottom-style:none;">
                            User Attributes
                        </td>
                    </tr>
                </table>
                  <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
              </div>
            </LayoutTemplate>

个人信息
公司信息
用户属性
请记住,这只是ListView的第一部分,因为整个内容非常庞大


无论如何,按钮都会出现,但它们根本不起任何作用……我是否必须在代码隐藏中执行某些操作?

从ListView提取DataPager,设置PagedControlID属性并实现PagePropertiesChange方法:

//set current page startindex, max rows and rebind to false
ContactsDataPager.SetPageProperties(e.StartRowIndex, e.MaximumRows, false);
//rebind List View
BindListView();
请看这篇文章:

将DataPager置于ListView之外,然后将DataPager的属性PagedControlID设置为ProfilesList