<%@ page language="C#" autoeventwireup="true" inherits="admin_adminset, webpages" %>

<!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>
</head>
<body style="text-align: center">
    <form id="form1" runat="server">
    <div>
      <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="24%" style="height: 19px; text-align: right">
              管理员：&nbsp;</td>
          <td style="height: 19px">&nbsp;<asp:TextBox ID="master1" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
          <td style="height: 24px; text-align: right">
              密码：&nbsp;</td>
          <td style="height: 24px">&nbsp;<asp:TextBox ID="password" runat="server"></asp:TextBox></td>
        </tr>
          <tr>
              <td style="height: 24px; text-align: right">
                  确认密码：&nbsp;</td>
              <td style="height: 24px">
                  &nbsp;<asp:TextBox ID="password1" runat="server"></asp:TextBox></td>
          </tr>
          <tr>
              <td style="height: 24px; text-align: right">
                  密码问题：&nbsp;</td>
              <td style="height: 24px">
                  &nbsp;
                  <asp:TextBox ID="wenti" runat="server"></asp:TextBox>&nbsp;
              </td>
          </tr>
          <tr>
              <td style="height: 24px; text-align: right">
                  密码答案：&nbsp;</td>
              <td style="height: 24px">
                  &nbsp;<asp:TextBox ID="daan" runat="server"></asp:TextBox></td>
          </tr>
          <tr>
              <td style="height: 24px; text-align: right">
              </td>
              <td style="height: 24px">
                  &nbsp;<asp:Button ID="Button1" runat="server" Text="添加" OnClick="Button1_Click" /></td>
          </tr>
      </table>
    </div>
        <br />
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            DataSourceID="SqlDataSource1" Width="98%" DataKeyNames="id" DataMember="DefaultView">
            <Columns>
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
                    SortExpression="id" />
                <asp:TemplateField HeaderText="管理员" SortExpression="admin">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("admin") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("admin") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="wenti" HeaderText="问题" SortExpression="wenti" />
                <asp:BoundField DataField="daan" HeaderText="答案" SortExpression="daan" />
                 <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                        <asp:Label ID="xgms" runat="server" Text='' ><a href="deladminset.aspx?id=<%# Eval("id") %> " target="_blank" >修改 </a></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                <asp:CommandField ShowEditButton="True" />
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                            Text="删除"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"  >
            <UpdateParameters>
                <asp:ControlParameter ControlID="GridView1" Name="id" PropertyName="SelectedValue" />
                <asp:ControlParameter ControlID="GridView1" Name="admin" PropertyName="SelectedValue" />
                <asp:ControlParameter ControlID="GridView1" Name="wenti" PropertyName="SelectedValue" />
                <asp:ControlParameter ControlID="GridView1" Name="daan" PropertyName="SelectedValue" />
            </UpdateParameters>
            <DeleteParameters>
                <asp:ControlParameter ControlID="GridView1" Name="id" PropertyName="SelectedValue" />
            </DeleteParameters>
        </asp:SqlDataSource>
    </form>
</body>
</html>
