ListViewTotalRowCount_Bug535701_1.aspx 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" EnableViewState="false" %>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head id="Head1" runat="server">
  5. <title>Untitled Page</title>
  6. </head>
  7. <body>
  8. <form id="form1" runat="server">
  9. <div>
  10. <%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><asp:ListView ID="ListViewTest" DataSourceID="ObjectDataSource1" runat="server" >
  11. <ItemTemplate><%# Container.DataItem %> </ItemTemplate>
  12. <LayoutTemplate>
  13. <div runat="server" id="itemPlaceHolder"></div>
  14. </LayoutTemplate>
  15. </asp:ListView>
  16. <asp:DataPager runat="server" ID="DataPager1" PagedControlID="ListViewTest">
  17. <Fields>
  18. <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="true"
  19. ShowLastPageButton="false" ShowNextPageButton="false" ShowPreviousPageButton="true"/>
  20. <asp:NumericPagerField ButtonCount="5" />
  21. <asp:NextPreviousPagerField ButtonType="Link" ShowFirstPageButton="false"
  22. ShowLastPageButton="true" ShowNextPageButton="true" ShowPreviousPageButton="false" />
  23. </Fields>
  24. </asp:DataPager><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
  25. <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" EnablePaging="True"
  26. SelectMethod="GetData" SelectCountMethod="GetCount">
  27. </asp:ObjectDataSource>
  28. </div>
  29. <script runat="server" type="text/C#">
  30. protected void Page_LoadComplete(object sender, EventArgs e)
  31. {
  32. ObjectDataSource1.TypeName = this.GetType().AssemblyQualifiedName;
  33. }
  34. public int[] GetData(int startRowIndex, int maximumRows)
  35. {
  36. int[] ret = new int[13];
  37. for (int i = 0; i < 13; i++)
  38. ret [i] = startRowIndex + i;
  39. return ret;
  40. }
  41. public int GetCount()
  42. {
  43. return GetData(0, 13).Length;
  44. }
  45. </script>
  46. </form>
  47. </body>
  48. </html>