<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NewsClass_2_List.aspx.cs" Inherits="admin_NewsClass_2_List" %>

<!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>
    <link href="images/StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div style="font-size:12px; text-align:center">
    <table class="tableBorder" cellspacing="1" cellpadding="3" align="center" border="0">
          <tbody>
            <tr>
              <th style="font-size:14px; color:#d6dff7; font-weight:bold; text-align:left;" class="tableHeaderText" height="25">
              &nbsp;&nbsp;&nbsp;&nbsp;二级类别管理</th>
            </tr>
          </tbody>
          <tbody>
          <tr><td class="forumRow">
         <div style="width:98%; text-align:right">
             一级分类:<asp:DropDownList runat="server" ID="Class_1ddl"></asp:DropDownList>
             类别名称:<asp:TextBox runat="server" ID="ClassNameTb"></asp:TextBox>
             <asp:Button runat="server" ID="searchBt" Text="查找" OnClick="searchBt_Click" CausesValidation="false" />
         </div>
        <asp:GridView runat="server" ID="Class_2Gv" AllowPaging="True" AutoGenerateColumns="False" Width="98%" EmptyDataText="暂无相关信息" DataKeyNames="ClassID_2" OnPageIndexChanging="Class_2Gv_PageIndexChanging" OnRowCancelingEdit="Class_2Gv_RowCancelingEdit" OnRowDeleting="Class_2Gv_RowDeleting" OnRowEditing="Class_2Gv_RowEditing" OnRowUpdating="Class_2Gv_RowUpdating" OnRowDataBound="Class_2Gv_RowDataBound">
            <Columns>
                <asp:TemplateField HeaderText="分类编号">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("ClassID_2") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="80px" />
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="一级分类">
                     <EditItemTemplate>
                          <asp:DropDownList runat="server" ID="Class_1ddl" ValidationGroup="updatevalid"></asp:DropDownList>
                          <asp:Label runat="server" ID="label" Text='<%# Bind("Class_1name") %>' Visible="false"></asp:Label>
                        
                     </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label runat="server" ID="Class_1nameLabel" Text='<%# Bind("Class_1name") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="250px" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="二级分类">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Class_2name") %>' Width="120px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="Class_2nameRFV" runat="server" Display="dynamic" ControlToValidate="TextBox1" ErrorMessage="输入二级分类" ValidationGroup="updatevalid"></asp:RequiredFieldValidator>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Class_2name") %>'></asp:Label>
                    </ItemTemplate>
                    <ItemStyle Width="220px" />
                </asp:TemplateField>
                <asp:CommandField HeaderText="编辑" ShowEditButton="True" ValidationGroup="updatevalid">
                    <ItemStyle Width="80px" />
                </asp:CommandField>
                <asp:TemplateField ShowHeader="False" HeaderText="删除">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                            Text="删除" OnClientClick="return confirm('是否真的删除?')"></asp:LinkButton>
                    </ItemTemplate>
                    <ItemStyle Width="50px" />
                </asp:TemplateField>
            </Columns>
            <pagersettings FirstPageText="首页" LastPageText="尾页" Mode="NextPreviousFirstLast"
                NextPageText="下一页" PreviousPageText="上一页" />
            
        </asp:GridView>
        <div style="width:98%; text-align:right">
            一级分类:<asp:DropDownList runat="server" ID="addtypeddl"></asp:DropDownList>
            <asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="addtypeddl"
                Display="Dynamic" ErrorMessage="请选择一级分类" OnServerValidate="CustomValidator1_ServerValidate"></asp:CustomValidator>
             类别名称:<asp:TextBox runat="server" ID="addtypeTb"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="addtypeTb"
                Display="Dynamic" ErrorMessage="请输入二级分类名称"></asp:RequiredFieldValidator>
             <asp:Button runat="server" ID="addtypeBt" Text="添加新分类" OnClick="addtypeBt_Click" />
        </div>
        </td></tr>
          </tbody>
          <tbody>
            <tr>
              <th class="tableHeaderText" height="25"></th>
            </tr>
          </tbody>
          </table>
    </div>
    </form>
</body>
</html>
