UserList.aspx
上传用户:gooyliu
上传日期:2018-09-29
资源大小:5816k
文件大小:5k
源码类别:

.net编程

开发平台:

C#

  1. <%@ Page Language="C#" MasterPageFile="~/SysAdmin/sysAdminMasterPage.Master" AutoEventWireup="true"
  2.     CodeBehind="UserList.aspx.cs" Inherits="Web.SysAdmin.UserList" Title="用户维护界面" %>
  3. <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  4.     <asp:GridView ID="gridviewUserList" runat="server" Width="386px" AutoGenerateColumns="False"
  5.         CellPadding="3" GridLines="Vertical" DataKeyNames="UserID" 
  6.         OnRowDeleting="gridviewUserList_RowDeleting"
  7.         OnRowEditing="gridviewUserList_RowEditing" 
  8.         onrowcancelingedit="gridviewUserList_RowCancelingEdit" 
  9.         onrowupdating="gridviewUserList_RowUpdating" 
  10.         ondatabinding="gridviewUserList_DataBinding" 
  11.         ondatabound="gridviewUserList_DataBound" 
  12.         onrowcommand="gridviewUserList_RowCommand" 
  13.         onrowcreated="gridviewUserList_RowCreated" 
  14.         onrowdatabound="gridviewUserList_RowDataBound" BackColor="White" 
  15.         BorderColor="#999999" BorderStyle="None" BorderWidth="1px" 
  16.         EmptyDataText="Null">
  17.         <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
  18.         <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
  19.         <Columns>
  20.             <asp:TemplateField HeaderText="用户ID" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="false">
  21.                 <EditItemTemplate>
  22.                      <asp:Label ID="lblUserID" runat="server"><%# Eval("userID")%></asp:Label>
  23.                 </EditItemTemplate>            
  24.                 <ItemTemplate>
  25.                     <asp:Label ID="Label1" runat="server" Text='<%# Bind("userID") %>'></asp:Label>
  26.                 </ItemTemplate>
  27. <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
  28.             </asp:TemplateField>
  29.             <asp:TemplateField HeaderText="姓名">
  30.                  <EditItemTemplate>
  31.                     <asp:TextBox ID="txtName" runat="server" Text='<%# Bind("UserName") %>'></asp:TextBox>
  32.                 </EditItemTemplate>
  33.                 <ItemTemplate>
  34.                     <asp:Label ID="lblName" runat="server"> <%#Eval("UserName")%></asp:Label>
  35.                 </ItemTemplate>
  36.             </asp:TemplateField>
  37.             <asp:TemplateField HeaderText="权限">
  38.                 <EditItemTemplate>
  39.                     <asp:HiddenField ID="hdfRole" runat="server" Value='<%# Eval("roleID") %>' />
  40.                     <asp:DropDownList ID="ddlRole" runat="server"  DataSource='<%#getDataSet() %>' DataTextField="roleName" DataValueField="roleID"> </asp:DropDownList>
  41.                 </EditItemTemplate>
  42.                 <ItemTemplate>
  43.                     <asp:Label  ID="lblRole" runat="server"> </asp:Label>
  44.                 </ItemTemplate>
  45.             </asp:TemplateField > 
  46.              <asp:TemplateField HeaderText="性别" ItemStyle-Wrap="false">
  47.                 <EditItemTemplate >   
  48.                     <asp:HiddenField ID="hdfGender" runat="server" Value='<%# Eval("userGender") %>' />
  49.                     <asp:DropDownList ID="ddlGender" runat="server"/>               
  50.                 </EditItemTemplate>                
  51.                 <ItemTemplate>
  52.                     <asp:Label  ID="lblGender" runat="server"> </asp:Label>
  53.                 </ItemTemplate>
  54.             </asp:TemplateField>
  55.             <asp:TemplateField HeaderText="院系">
  56.                 <EditItemTemplate>
  57.                     <asp:TextBox ID="txtDept" runat="server" Text='<%#Bind("userDepartment")%>'></asp:TextBox>
  58.                 </EditItemTemplate>
  59.                 <ItemTemplate>
  60.                     <asp:Label runat="server"><%#Eval("userDepartment") %></asp:Label>
  61.                 </ItemTemplate>
  62.             </asp:TemplateField>
  63.             <asp:TemplateField HeaderText="住址">
  64.                 <EditItemTemplate>
  65.                     <asp:TextBox ID="txtAddress" runat="server" Text='<%# Bind("userAddress") %>'></asp:TextBox>
  66.                 </EditItemTemplate>
  67.                 <ItemTemplate>
  68.                     <asp:Label ID="Label2" runat="server"><%#Eval("userAddress")%></asp:Label>
  69.                 </ItemTemplate>
  70.             </asp:TemplateField>
  71.             <asp:CommandField HeaderText="删除" ShowDeleteButton="True" DeleteText="删除"  
  72.                 ButtonType="Link" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="false">
  73. <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
  74.             </asp:CommandField>
  75.             <asp:CommandField HeaderText="编辑" CancelText="取消" EditText="编辑" ShowEditButton="True"
  76.                 UpdateText="更新" ButtonType="Button"  HeaderStyle-HorizontalAlign="Justify">
  77. <HeaderStyle HorizontalAlign="Justify"></HeaderStyle>
  78.             </asp:CommandField>
  79.         </Columns>
  80.         <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
  81.         <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
  82.         <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
  83.         <AlternatingRowStyle BackColor="#DCDCDC" />
  84.     </asp:GridView>
  85.     <asp:Label ID="lblDebugMsg" runat="server" EnableViewState="False" />
  86. </asp:Content>