FormViewTest1.aspx 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %>
  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 runat="server">
  5. <title>Untitled Page</title>
  6. </head>
  7. <body>
  8. <form id="form1" runat="server">
  9. <div>
  10. test1
  11. &nbsp;<asp:FormView ID="FormView1" runat="server" AllowPaging="True" BackColor="#DEBA84"
  12. BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2"
  13. DataSourceID="ObjectDataSource1" GridLines="Both">
  14. <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
  15. <EditRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" />
  16. <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
  17. <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
  18. <ItemTemplate>
  19. <asp:Label ID="Label1" runat="server" Text="<%# FormView1.DataItem.ToString() %>"></asp:Label>
  20. </ItemTemplate>
  21. <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" />
  22. </asp:FormView>
  23. <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
  24. DeleteMethod="DeleteList" InsertMethod="InsertList" SelectMethod="GetMyList"
  25. TypeName="MonoTests.System.Web.UI.WebControls.TestMyData" UpdateMethod="UpdateList">
  26. <DeleteParameters>
  27. <asp:Parameter Name="value" Type="Int32" />
  28. </DeleteParameters>
  29. <InsertParameters>
  30. <asp:Parameter Name="value" Type="Int32" />
  31. </InsertParameters>
  32. <UpdateParameters>
  33. <asp:Parameter Name="index" Type="Int32" />
  34. <asp:Parameter Name="value" Type="Int32" />
  35. </UpdateParameters>
  36. </asp:ObjectDataSource>
  37. test2
  38. <asp:FormView ID="FormView2" runat="server" AllowPaging="True" CellPadding="4" DataSourceID="ObjectDataSource1"
  39. ForeColor="#333333">
  40. <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
  41. <EditRowStyle BackColor="#999999" />
  42. <PagerTemplate>
  43. <asp:Button ID="Button1" runat="server" CommandArgument='<%# "Prev" %>' Text='<%# "Prev Item" %>' CommandName='<%# "Page" %>' />
  44. <asp:Button ID="Button2" runat="server" CommandArgument='<%# "Next" %>' Text='<%# "Next Item" %>' CommandName='<%# "Page" %>' />
  45. <asp:Button ID="Button3" runat="server" CommandArgument='<%# "First" %>' Text='<%# "First Item" %>' CommandName='<%# "Page" %>' />
  46. <asp:Button ID="Button4" runat="server" CommandArgument='<%# "Last" %>' Text='<%# "Last Item" %>' CommandName='<%# "Page" %>' />
  47. </PagerTemplate>
  48. <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
  49. <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
  50. <FooterTemplate>
  51. <asp:Label ID="Label3" runat="server" Text='<%# "Footer Template Test" %>'></asp:Label>
  52. </FooterTemplate>
  53. <ItemTemplate>
  54. <asp:Label ID="Label2" runat="server" Text="<%# FormView2.DataItem.ToString() %>"></asp:Label>
  55. </ItemTemplate>
  56. <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
  57. </asp:FormView>
  58. </div>
  59. test3
  60. <asp:FormView ID="FormView3" runat="server" AllowPaging="True" BackColor="LightGoldenrodYellow"
  61. BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataSourceID="ObjectDataSource1"
  62. ForeColor="Black">
  63. <FooterStyle BackColor="Tan" ForeColor="#FFC0FF" HorizontalAlign="Right" />
  64. <EditRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
  65. <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
  66. <FooterTemplate>
  67. <asp:Label ID="Label6" runat="server" Text='<%# "FormView Footer" %>'></asp:Label>
  68. </FooterTemplate>
  69. <ItemTemplate>
  70. <asp:Label ID="Label4" runat="server" Text="<%# FormView3.DataItem.ToString() %>"></asp:Label>
  71. </ItemTemplate>
  72. <HeaderStyle BackColor="Tan" Font-Bold="True" ForeColor="#C00000" HorizontalAlign="Center" VerticalAlign="Top" />
  73. <HeaderTemplate>
  74. <asp:Label ID="Label5" runat="server" Text='<%# "Header Template Test" %>'></asp:Label>
  75. </HeaderTemplate>
  76. </asp:FormView>
  77. test4
  78. <asp:FormView ID="FormView4" runat="server" AllowPaging="True" BackColor="White"
  79. BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="10"
  80. DataSourceID="ObjectDataSource1" DefaultMode="Edit" FooterText="Using Footer Text property"
  81. GridLines="Both" HeaderText="Using Header Text property" HorizontalAlign="Right" CaptionAlign="Right">
  82. <FooterStyle BackColor="Maroon" ForeColor="#000066" HorizontalAlign="Center" />
  83. <EditRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
  84. <PagerTemplate>
  85. <asp:LinkButton ID="LinkButton1" runat="server" CommandArgument='<%# "Next" %>' Text='<%# "Next" %>' CommandName='<%# "Page" %>'></asp:LinkButton>
  86. <asp:LinkButton ID="LinkButton2" runat="server" CommandArgument='<%# "Prev" %>' Text='<%# "Prev" %>' CommandName='<%# "Page" %>'></asp:LinkButton>
  87. <asp:Label ID="Label7" runat="server" Text='<%# "Page Index: "+ FormView4.PageIndex %>'></asp:Label>
  88. </PagerTemplate>
  89. <RowStyle BackColor="#FF8080" ForeColor="#000066" HorizontalAlign="Center" />
  90. <PagerStyle BackColor="LightGray" ForeColor="#000066" HorizontalAlign="Left" />
  91. <ItemTemplate>
  92. &nbsp;<asp:TextBox ID="TextBox1" runat="server" Text="<%# FormView4.DataItem.ToString() %>"></asp:TextBox>
  93. </ItemTemplate>
  94. <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" HorizontalAlign="Left" />
  95. </asp:FormView>
  96. endtest
  97. </form>
  98. </body>
  99. </html>
  100. endtest