ListViewTest.aspx 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  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></title>
  6. </head>
  7. <body>
  8. <form id="form1" runat="server">
  9. <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
  10. SelectMethod="GetCountries" TypeName="TestCode.CountryCollection"
  11. SortParameterName="sortExpression" UpdateMethod="Update"
  12. DeleteMethod="Delete" InsertMethod="Insert">
  13. <DeleteParameters>
  14. <asp:Parameter Name="id" Type="Int32" />
  15. </DeleteParameters>
  16. <UpdateParameters>
  17. <asp:Parameter Name="id" Type="Int32" />
  18. <asp:Parameter Name="name" Type="String" />
  19. <asp:Parameter Name="capital" Type="String" />
  20. <asp:Parameter Name="population" Type="Double" />
  21. </UpdateParameters>
  22. <SelectParameters>
  23. <asp:Parameter Name="sortExpression" Type="String" />
  24. </SelectParameters>
  25. <InsertParameters>
  26. <asp:Parameter Name="id" Type="Int32" />
  27. <asp:Parameter Name="name" Type="String" />
  28. <asp:Parameter Name="capital" Type="String" />
  29. <asp:Parameter Name="population" Type="Double" />
  30. </InsertParameters>
  31. </asp:ObjectDataSource>
  32. <div>
  33. <t:ListViewPoker ID="ListView1" runat="server" DataSourceID="ObjectDataSource1" InsertItemPosition="LastItem">
  34. <ItemTemplate>
  35. <tr style="">
  36. <td>
  37. <asp:Button ID="DeleteButton" runat="server" CommandName="Delete"
  38. Text="Delete" />
  39. <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
  40. <asp:Button ID="SelectButton" runat="server" CommandName="Select" Text="Select" />
  41. </td>
  42. <td>
  43. <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
  44. </td>
  45. <td>
  46. <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
  47. </td>
  48. <td>
  49. <asp:Label ID="CapitalLabel" runat="server" Text='<%# Eval("Capital") %>' />
  50. </td>
  51. <td>
  52. <asp:Label ID="PopulationLabel" runat="server"
  53. Text='<%# Eval("Population") %>' />
  54. </td>
  55. </tr>
  56. </ItemTemplate>
  57. <AlternatingItemTemplate>
  58. <tr style="">
  59. <td>
  60. <asp:Button ID="DeleteButton" runat="server" CommandName="Delete"
  61. Text="Delete" />
  62. <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
  63. <asp:Button ID="SelectButton" runat="server" CommandName="Select" Text="Select" />
  64. </td>
  65. <td>
  66. <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
  67. </td>
  68. <td>
  69. <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
  70. </td>
  71. <td>
  72. <asp:Label ID="CapitalLabel" runat="server" Text='<%# Eval("Capital") %>' />
  73. </td>
  74. <td>
  75. <asp:Label ID="PopulationLabel" runat="server"
  76. Text='<%# Eval("Population") %>' />
  77. </td>
  78. </tr>
  79. </AlternatingItemTemplate>
  80. <EmptyDataTemplate>
  81. <table runat="server"
  82. style="">
  83. <tr>
  84. <td>
  85. No data was returned.</td>
  86. </tr>
  87. </table>
  88. </EmptyDataTemplate>
  89. <InsertItemTemplate>
  90. <tr style="">
  91. <td>
  92. <asp:Button ID="InsertButton" runat="server" CommandName="Insert"
  93. Text="Insert" />
  94. <asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
  95. Text="Clear" />
  96. </td>
  97. <td>
  98. <asp:TextBox ID="IDTextBox" runat="server" Text='<%# Bind("ID") %>' />
  99. </td>
  100. <td>
  101. <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
  102. </td>
  103. <td>
  104. <asp:TextBox ID="CapitalTextBox" runat="server" Text='<%# Bind("Capital") %>' />
  105. </td>
  106. <td>
  107. <asp:TextBox ID="PopulationTextBox" runat="server"
  108. Text='<%# Bind("Population") %>' />
  109. </td>
  110. </tr>
  111. </InsertItemTemplate>
  112. <LayoutTemplate>
  113. <table runat="server">
  114. <tr runat="server">
  115. <td runat="server">
  116. <table ID="itemPlaceholderContainer" runat="server" border="0"
  117. style="">
  118. <tr runat="server" style="">
  119. <th runat="server">
  120. </th>
  121. <th runat="server">
  122. ID</th>
  123. <th runat="server">
  124. Name</th>
  125. <th runat="server">
  126. Capital</th>
  127. <th runat="server">
  128. Population</th>
  129. </tr>
  130. <tr ID="itemPlaceholder" runat="server">
  131. </tr>
  132. </table>
  133. </td>
  134. </tr>
  135. <tr runat="server">
  136. <td runat="server"
  137. style="">
  138. </td>
  139. </tr>
  140. </table>
  141. </LayoutTemplate>
  142. <EditItemTemplate>
  143. <tr style="">
  144. <td>
  145. <asp:Button ID="UpdateButton" runat="server" CommandName="Update"
  146. Text="Update" />
  147. <asp:Button ID="CancelButton" runat="server" CommandName="Cancel"
  148. Text="Cancel" />
  149. </td>
  150. <td>
  151. <asp:TextBox ID="IDTextBox" runat="server" Text='<%# Bind("ID") %>' />
  152. </td>
  153. <td>
  154. <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>' />
  155. </td>
  156. <td>
  157. <asp:TextBox ID="CapitalTextBox" runat="server" Text='<%# Bind("Capital") %>' />
  158. </td>
  159. <td>
  160. <asp:TextBox ID="PopulationTextBox" runat="server"
  161. Text='<%# Bind("Population") %>' />
  162. </td>
  163. </tr>
  164. </EditItemTemplate>
  165. <SelectedItemTemplate>
  166. <tr style="">
  167. <td>
  168. <asp:Button ID="DeleteButton" runat="server" CommandName="Delete"
  169. Text="Delete" />
  170. <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="Edit" />
  171. </td>
  172. <td>
  173. <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
  174. </td>
  175. <td>
  176. <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
  177. </td>
  178. <td>
  179. <asp:Label ID="CapitalLabel" runat="server" Text='<%# Eval("Capital") %>' />
  180. </td>
  181. <td>
  182. <asp:Label ID="PopulationLabel" runat="server"
  183. Text='<%# Eval("Population") %>' />
  184. </td>
  185. </tr>
  186. </SelectedItemTemplate>
  187. </t:ListViewPoker>
  188. </div>
  189. </form>
  190. </body>
  191. </html>