- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserInfo.aspx.cs" Inherits="user_UserInfo" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>无标题页</title>
- <script type="text/javascript">
- function pageLoad() {
- }
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- </div>
- <asp:AccessDataSource ID="AccessDataSource1" runat="server"
- DataFile="~/App_Data/Employee.mdb" DeleteCommand="DELETE FROM Employee where id=?"
- InsertCommand="INSERT INTO Employee(name,sex,department) VALUES (?,?,?)"
- SelectCommand="SELECT * FROM [Employee]"
- UpdateCommand="UPDATE Employee SET name =?, sex =?, department =? where id=?">
- <DeleteParameters>
- <asp:Parameter Name="id" />
- </DeleteParameters>
- <UpdateParameters>
- <asp:Parameter Name="name" />
- <asp:Parameter Name="sex" />
- <asp:Parameter Name="department" />
- <asp:Parameter Name="id" />
- </UpdateParameters>
- <InsertParameters>
- <asp:Parameter Name="name" />
- <asp:Parameter Name="sex" />
- <asp:Parameter Name="department" />
- </InsertParameters>
- </asp:AccessDataSource>
- <asp:ListView ID="ListView1" runat="server" DataKeyNames="ID"
- DataSourceID="AccessDataSource1" InsertItemPosition="LastItem">
- <ItemTemplate>
- <tr style="background-color: #E0FFFF;color: #333333;">
- <td>
- <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="删除" />
- <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
- </td>
- <td>
- <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
- </td>
- <td>
- <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
- </td>
- <td>
- <asp:Label ID="sexLabel" runat="server" Text='<%# Eval("sex") %>' />
- </td>
- <td>
- <asp:Label ID="departmentLabel" runat="server"
- Text='<%# Eval("department") %>' />
- </td>
- </tr>
- </ItemTemplate>
- <AlternatingItemTemplate>
- <tr style="background-color: #FFFFFF;color: #284775;">
- <td>
- <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="删除" />
- <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
- </td>
- <td>
- <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
- </td>
- <td>
- <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
- </td>
- <td>
- <asp:Label ID="sexLabel" runat="server" Text='<%# Eval("sex") %>' />
- </td>
- <td>
- <asp:Label ID="departmentLabel" runat="server"
- Text='<%# Eval("department") %>' />
- </td>
- </tr>
- </AlternatingItemTemplate>
- <EmptyDataTemplate>
- <table runat="server"
- style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
- <tr>
- <td>
- 未返回数据。</td>
- </tr>
- </table>
- </EmptyDataTemplate>
- <InsertItemTemplate>
- <tr style="">
- <td>
- <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="插入" />
- <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="清除" />
- </td>
- <td>
- </td>
- <td>
- <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' />
- </td>
- <td>
- <asp:TextBox ID="sexTextBox" runat="server" Text='<%# Bind("sex") %>' />
- </td>
- <td>
- <asp:TextBox ID="departmentTextBox" runat="server"
- Text='<%# Bind("department") %>' />
- </td>
- </tr>
- </InsertItemTemplate>
- <LayoutTemplate>
- <table runat="server">
- <tr runat="server">
- <td runat="server">
- <table ID="itemPlaceholderContainer" runat="server" border="1"
- style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
- <tr runat="server" style="background-color: #E0FFFF;color: #333333;">
- <th runat="server">
- </th>
- <th runat="server">
- ID</th>
- <th runat="server">
- 姓名</th>
- <th runat="server">
- 性别</th>
- <th runat="server">
- 部门</th>
- </tr>
- <tr ID="itemPlaceholder" runat="server">
- </tr>
- </table>
- </td>
- </tr>
- <tr runat="server">
- <td runat="server"
- style="text-align: center;background-color: #5D7B9D;font-family: Verdana, Arial, Helvetica, sans-serif;color: #FFFFFF">
- <asp:DataPager ID="DataPager1" runat="server">
- <Fields>
- <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True"
- ShowLastPageButton="True" />
- </Fields>
- </asp:DataPager>
- </td>
- </tr>
- </table>
- </LayoutTemplate>
- <EditItemTemplate>
- <tr style="background-color: #999999;">
- <td>
- <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="更新" />
- <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="取消" />
- </td>
- <td>
- <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
- </td>
- <td>
- <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' />
- </td>
- <td>
- <asp:TextBox ID="sexTextBox" runat="server" Text='<%# Bind("sex") %>' />
- </td>
- <td>
- <asp:TextBox ID="departmentTextBox" runat="server"
- Text='<%# Bind("department") %>' />
- </td>
- </tr>
- </EditItemTemplate>
- <SelectedItemTemplate>
- <tr style="background-color: #E2DED6;font-weight: bold;color: #333333;">
- <td>
- <asp:Button ID="DeleteButton" runat="server" CommandName="Delete" Text="删除" />
- <asp:Button ID="EditButton" runat="server" CommandName="Edit" Text="编辑" />
- </td>
- <td>
- <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
- </td>
- <td>
- <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
- </td>
- <td>
- <asp:Label ID="sexLabel" runat="server" Text='<%# Eval("sex") %>' />
- </td>
- <td>
- <asp:Label ID="departmentLabel" runat="server"
- Text='<%# Eval("department") %>' />
- </td>
- </tr>
- </SelectedItemTemplate>
- </asp:ListView>
- </form>
- </body>
- </html>