经过前面系统分析和数据库设计,文章管理系统的基本设计环境已经建立起来了,按照管理信息系统设计的环节,现在已经进入了系统实施阶段。本系统拟采用Visual Studio.NET2003设计。使用Visual Studio.NET2003新建一个Web应用程序 ,命名为TheArticleSYS,具体步骤略。下面,我们按照数据信息积累分先后顺序详细介绍本系统的设计与编写。首先是后台管理部分,然后是前台浏览和检索部分。
14.3.1 Admin_Management.aspx的设计与编码
为了系统界面更加紧凑,我们把后台管理部分的文章分类管理功能模块和文章信息管理功能模块集成到Admin_Management.aspx窗体内,并提供了文章发布的入口。
Admin_Management.aspx窗体的前台HTML代码如下:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Admin_Management.aspx.vb" Inherits="TheArticleSYS.Admin_Management"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>Admin_Management</title>
<meta name="vs_snapToGrid" content="True">
<meta name="vs_showGrid" content="True">
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<center>
<table>
<tr>
<td style="FONT-WEIGHT: bold; FONT-SIZE: 16pt; COLOR: white; HEIGHT: 50px; BACKGROUND-COLOR: #009999; TEXT-ALIGN: center">管理员管理窗口</td>
<tr>
<td width="762" align="center" style="BORDER-RIGHT: #009999 1pt solid; BORDER-TOP: #009999 1pt solid; BORDER-LEFT: #009999 1pt solid; BORDER-BOTTOM: #009999 1pt solid">
<form id="Form1" method="post" runat="server">
<asp:Panel id="Panel1" runat="server">
<TABLE id="Table1" cellSpacing="1" cellPadding="1" width="500" border="1">
<TR>
<TD><FONT face="宋体">管理员ID</FONT></TD>
<TD>
<asp:TextBox id="TextBox1" runat="server"></asp:TextBox></TD>
</TR>
<TR>
<TD><FONT face="宋体">密码</FONT></TD>
<TD>
<asp:TextBox id="TextBox2" runat="server" TextMode="Password"></asp:TextBox></TD>
</TR>
<TR>
<TD align="center" colSpan="2">
<asp:Button id="Button1" runat="server" Text="登录"></asp:Button></TD>
</TR>
</TABLE>
</asp:Panel>
<asp:Panel id="Panel2" runat="server" Visible="False">
<asp:Button id="Button3" runat="server" Text="文章类别管理 " Height="32px"></asp:Button>
<asp:Button id="Button4" runat="server" Text="文章信息管理" Height="32px" Width="120px"></asp:Button>
<FONT face="宋体"><a href="Add_Articles.aspx" target="_blank">发布新文章</a></FONT>
</asp:Panel>
<asp:Panel id="Panel3" runat="server" Visible="False">
<TABLE id="Table3" cellSpacing="1" cellPadding="1" width="758" border="1">
<TR>
<TD style="FONT-SIZE: 11pt"><FONT face="宋体">按类别分类</FONT>
<asp:DropDownList id="DropDownList1" runat="server" Width="80px" AutoPostBack="True"></asp:DropDownList><FONT face="宋体"> 按标题检索</FONT>
<asp:TextBox id="TextBox4" runat="server"></asp:TextBox>
<asp:DropDownList id="DropDownList2" runat="server">
<asp:ListItem Value="0" Selected="True">模糊标题查找</asp:ListItem>
<asp:ListItem Value="1">精确标题查找</asp:ListItem>
</asp:DropDownList>
<asp:Button id="Button5" runat="server" Text="GoSearch"></asp:Button></TD>
</TR>
<TR>
<TD style="HEIGHT: 21px">
<asp:DataGrid id="DataGrid2" runat="server" Height="312px" Width="752px" AutoGenerateColumns="False"
BorderWidth="1px" BorderColor="#CCCCCC" BackColor="White" BorderStyle="None" CellPadding="3"
AllowPaging="True" Font-Size="X-Small">
<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#669999"></SelectedItemStyle>
<ItemStyle ForeColor="#000066"></ItemStyle>
<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#006699"></HeaderStyle>
<FooterStyle ForeColor="#000066" BackColor="White"></FooterStyle>
<Columns>
<asp:BoundColumn DataField="id" ReadOnly="True" HeaderText="编号"></asp:BoundColumn>
<asp:BoundColumn DataField="title" HeaderText="文章标题"></asp:BoundColumn>
<asp:BoundColumn DataField="writer" ReadOnly="True" HeaderText="作者"></asp:BoundColumn>
<asp:BoundColumn DataField="sdate" ReadOnly="True" HeaderText="发布时间"></asp:BoundColumn>
&nbs