使用纯粹的asp+语言制作的栏目管理(三)

/*
豆腐制作 都是精品
http://www.asp888.net 豆腐技术站
如转载 请保留完整版权信息
*/
呵呵,连续看了几个特别复杂的程序,相信大的脑袋已经和 豆腐 的脑袋差不多 变成了一个大大的。。好吧,最后写个简单简单的程序,我们就算是 作个总结吧!
我们在前面的程序中将我们的栏目的所有的 标题都已经用分页的方法显示出来了,所以我们在这里做上一个把栏目的内容显示出来的程序就可以了,这个程序很简单,大家可以舒服的靠在椅子上来阅读这篇文章
viewarticl.aspx:

1@ Import Namespace="System.Data" 
1@ Import Namespace="System.Data.SQL" 
 1<script language="C#" runat="server">   
 2protected void Page_Load(Object Src, EventArgs E){   
 3int intRecID=Request.QueryString["id"].ToInt16();   
 4SQLDataReader dbRead;   
 5SQLCommand dbComm;   
 6String strSQL;   
 7String strConn;   
 8SQLConnection conn;   
 9Hashtable Cfg=new Hashtable();   
10Cfg = (Hashtable)Context.GetConfig("appsettings");   
11strConn=Cfg["Conn"].ToString();   
12conn = new SQLConnection(strConn);   
13strSQL="select * from lanmu where id=" + intRecID.ToString();   
14dbComm=new SQLCommand(strSQL,conn);   
15dbComm.ActiveConnection.Open();   
16dbComm.Execute(out dbRead);   
17if(!dbRead.Read()){   
18showmsg.Text="对不起,没有编号为" + intRecID.ToString() + "的文章";   
19return;   
20}   
21//HttpServerUtility server=new HttpServerUtility();   
22showmsg.Text=Server.HtmlEncode(dbRead["content"].ToString());   
23}   
24</script>
1<html>
2<head>
3<title>浏览文章__技术专栏__```
4=sqlRead("title")
5```</title>   

=GrabPage("/inc/head.inc")

1<link href="/doufu.css" rel="stylesheet" type="text/css"/>
2</head>
3<body>
4<asp:label id="showmsg" runat="server"></asp:label>
5</body>
6</html>
Published At
Categories with Web编程
Tagged with
comments powered by Disqus