PageRenderTime 30ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 1ms

/Visual Studio 2008/CSASPNETFormViewUpload/Default.aspx

#
ASP.NET | 112 lines | 110 code | 2 blank | 0 comment | 0 complexity | e69b9fa36b1235812b1b0b3211f16dda MD5 | raw file
  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CSASPNETFormViewUpload.Default" %>
  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. <div>
  10. <asp:FormView ID="fvPerson" runat="server"
  11. onitemdeleting="fvPerson_ItemDeleting" oniteminserting="fvPerson_ItemInserting"
  12. onitemupdating="fvPerson_ItemUpdating"
  13. onpageindexchanging="fvPerson_PageIndexChanging"
  14. onmodechanging="fvPerson_ModeChanging">
  15. <EditItemTemplate>
  16. <table style="width: 400px;" >
  17. <tr>
  18. <td style="width: 128px; height: 128px;" rowspan="2">
  19. <asp:Image ID="imgPicture" runat="server"
  20. ImageUrl ='<%# Eval("PersonID","Image.aspx?PersonID={0}") %>' Width="128px"
  21. Height="128px" />
  22. </td>
  23. <td valign="top">
  24. Person ID:
  25. <asp:Label ID="lblPersonID" runat="server" Text='<%# Eval("PersonID") %>' />
  26. <br />
  27. First name:
  28. <asp:TextBox ID="tbFirstName" runat="server"
  29. Text='<%# Bind("FirstName") %>' />
  30. <br />
  31. Last name:
  32. <asp:TextBox ID="tbLastName" runat="server"
  33. Text='<%# Bind("LastName") %>' />
  34. <br />
  35. Picture path:
  36. <asp:FileUpload ID="uploadPicture" runat="server" />
  37. </td>
  38. </tr>
  39. <tr>
  40. <td valign="bottom">
  41. <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True"
  42. CommandName="Update" Text="Update" />
  43. &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server"
  44. CausesValidation="False" CommandName="Cancel" Text="Cancel" />
  45. </td>
  46. </tr>
  47. </table>
  48. </EditItemTemplate>
  49. <InsertItemTemplate>
  50. <table style="width: 400px;" >
  51. <tr>
  52. <td height="100px" valign="top">
  53. First name:
  54. <asp:TextBox ID="tbFirstName" runat="server"
  55. Text='<%# Bind("FirstName") %>' />
  56. <br />
  57. Last name:
  58. <asp:TextBox ID="tbLastName" runat="server"
  59. Text='<%# Bind("LastName") %>' />
  60. <br />
  61. Picture path:
  62. <asp:FileUpload ID="uploadPicture" runat="server" />
  63. </td>
  64. </tr>
  65. <tr>
  66. <td height="28px" valign="bottom">
  67. <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True"
  68. CommandName="Insert" Text="Insert" />
  69. &nbsp;<asp:LinkButton ID="InsertCancelButton" runat="server"
  70. CausesValidation="False" CommandName="Cancel" Text="Cancel" />
  71. </td>
  72. </tr>
  73. </table>
  74. </InsertItemTemplate>
  75. <ItemTemplate>
  76. <table style="width: 400px;">
  77. <tr>
  78. <td style="width: 128px; height: 128px;" rowspan="2">
  79. <asp:Image ID="imgPicture" runat="server"
  80. ImageUrl ='<%# Eval("PersonID","Image.aspx?PersonID={0}") %>' Width="128px"
  81. Height="128px" />
  82. </td>
  83. <td valign="top">
  84. Person ID:
  85. <asp:Label ID="lblPersonID" runat="server" Text='<%# Eval("PersonID") %>' />
  86. <br />
  87. First name:
  88. <asp:Label ID="lblFirstName" runat="server" Text='<%# Eval("FirstName") %>' />
  89. <br />
  90. Last name:
  91. <asp:Label ID="lblLastName" runat="server" Text='<%# Eval("LastName") %>' />
  92. </td>
  93. </tr>
  94. <tr>
  95. <td valign="bottom">
  96. <asp:LinkButton ID="EditButton" runat="server" CausesValidation="False"
  97. CommandName="Edit" Text="Edit" />
  98. &nbsp;<asp:LinkButton ID="DeleteButton" runat="server" CausesValidation="False"
  99. CommandName="Delete" Text="Delete" />
  100. &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False"
  101. CommandName="New" Text="New" />
  102. </td>
  103. </tr>
  104. </table>
  105. </ItemTemplate>
  106. </asp:FormView>
  107. </div>
  108. </form>
  109. </body>
  110. </html>