<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BlogCategory.aspx.cs" Inherits="Admin_BlogCategory" %>
<%@ Import Namespace ="Spaces" %>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=Globals.Text["BlogCategory_PageNav"]%></title>

<link href="Admin.css" rel="stylesheet" type="text/css">

    <script src="<%=Globals.ApplicationPath %>/Include/js/dialog.js" type="text/javascript"></script>

    <script src="<%=Globals.ApplicationPath %>/Include/js/base.js" type="text/javascript"></script>
   <script>
    function check_title(sStr)
{
	if (sStr.length == '')
	{
		_error_msg_show('分类名称不能为空');
		return false;
	}
	else if (sStr.length > 28)
	{
		_error_msg_show('分类名称长度不能超过28个字符或14个汉字');
		return false;
	}
	return true;
}

    </script>

</head>
<body>
 <form id="Form1" runat="server">

<table width="640" border="0" align="center" cellpadding="0" cellspacing="0"  >
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="3" height="3"><img src="img/O_angle_up_left.gif" width="3" height="3"></td>
          <td bgcolor="#ACD373" width="100%"></td>
          <td width="3"><img src="img/O_angle_up_right.gif" width="3" height="3"></td>
        </tr>
    </table></td>
  </tr>
  <tr>
       <td bgcolor="#acd373" height=30>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#ffffff"><B><%=Globals.Text["BlogCategory_BlogManage"]%></B></font> 
                    </td>
  </tr>
  <tr>
    <td class="form_border">
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="20">&nbsp;</td>
          <td>&nbsp;</td>
          <td width="20">&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><table width="100%"  border="0" cellspacing="0" cellpadding="0"  >
              <tr> 
                <td align="right" > <font color="#FF6600"><a href="editPost.aspx"><%=Globals.Text["BlogCategory_PublishArtical"]%></a></font> 
                </td>
              </tr>
              <tr> 
                <td> <fieldset>
                  <legend>&nbsp;<%=Globals.Text["BlogCategory_ArticalManage"]%>&nbsp;</legend>
                  <div align="right"><%=Globals.Text["BlogCategory_BlogInterface"]%><br>
                    　　<%=Globals.Text["BlogCategory_BlogEdit"]%><br>
                    <br>
                  </div>
                  </fieldset></td>
              </tr>
              <tr> 
                <td height="5"></td>
              </tr>
              <tr> 
                <td ></td>
              <tr> 
                <td> 
                  <!-- 功能列表 -->
                  <!-- /功能列表 -->
                  <!-- 分类列表 -->
                  <!-- /分类列表 -->
                </td>
              </tr>
            </table></td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="0"  >
              <tr>
                <td width="51%" align="right">&nbsp;</td>
                <td width="18%" align="right">
                    <%=Globals.Text["BlogCategory_BlogCategory"]%></td>
                <td width="31%" nowrap> <asp:TextBox ID="CategoryName" runat="server"></asp:TextBox>
                <asp:Button ID="AddBtn" runat="server" OnClick="AddBtn_Click" Text="添加" OnClientClick="return checkName()" />
                <script type="text/javascript">
              
                 function checkName()
                 {
                  var categoryName=$('<%=CategoryName.ClientID %>');
                  if(categoryName.value.trim()=='')
                  {
                  _error_msg_show('分类输入值不能为空:S');
                  return false;
                  }
                 }
                </script>
                </td>
              </tr>
            </table>
            
            
             
                <asp:GridView ID="categoryView" runat="server" CellPadding="3" CellSpacing="2" BackColor="#FFFFFF" Css  AutoGenerateColumns="False" Width="100%" BorderWidth="0px">
                    <RowStyle BackColor="#EEF5E2"  />
                    <HeaderStyle BackColor="#669900" ForeColor="#FFFFFF" />
                    <Columns>
                        <asp:TemplateField HeaderText="目录名">
                            <EditItemTemplate>
                             <asp:HiddenField ID="CategoryID" runat="server" Value='<%# Bind("CategoryID") %>' />
                                <asp:TextBox ID="Title" runat="server" Text='<%# Bind("Title") %>' onblur="check_title(this.value)"></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                            <asp:HiddenField ID="CategoryID" runat="server" Value='<%# Bind("CategoryID") %>' />
                            
                                <asp:Label ID="Title" runat="server" Text='<%# Bind("Title") %>'></asp:Label>
                            </ItemTemplate>
                        
                        </asp:TemplateField>

                        <asp:CommandField ItemStyle-HorizontalAlign="Center" ShowEditButton="True" EditImageUrl="./img/edit.gif" EditText="<img src='./img/edit.gif' width='20' height='18' />" HeaderText="编辑"/>
                         <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="删除">
<ItemTemplate>
<asp:LinkButton ID="delCategory" Runat="server" 
OnClientClick="return confirm('确定要删除目录吗?');" CommandName="Delete"><img src="./img/icon_del.gif" width="14" height="14" /></asp:LinkButton>
</ItemTemplate></asp:TemplateField>
                    </Columns>
                
                </asp:GridView>
              &nbsp;</td>
          <td>&nbsp;</td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td height="30" bgcolor="#E3F0D0"  align=center >&nbsp;  </td>
  </tr>
 
</table>
    
    </form>
</body>
</html>
