制作内幕 游戏 网站 图标 | 理论 图标在线制作 | 看图软件 访谈活动 | 教程 技术 万年历
当前位置:首页>CG 教 程>网站开发>ASP.NET>

相关文章

推荐文章

     

热门文章

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

作者:CG谷 出处: 发布时间:2006-07-11 字体: [ ]

http://www.asp888.net 豆腐技术站

呵呵,连续看了几个特别复杂的程序,相信大的脑袋已经和 豆腐 的脑袋差不多 变成了一个大大的。。
好吧,最后写个简单简单的程序,我们就算是 作个总结吧!
我们在前面的程序中将我们的栏目的所有的 标题都已经用分页的方法显示出来了,所以我们在这里做上
一个把栏目的内容显示出来的程序就可以了,这个程序很简单,大家可以舒服的靠在椅子上来阅读这篇文章
viewarticl.aspx:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SQL" %>
<script runat=server language="C#">
protected void Page_Load(Object Src, EventArgs E){
int intRecID=Request.QueryString["id"].ToInt16();
SQLDataReader dbRead;
SQLCommand dbComm;
String strSQL;
String strConn;
SQLConnection conn;
Hashtable Cfg=new Hashtable();
Cfg = (Hashtable)Context.GetConfig("appsettings");
strConn=Cfg["Conn"].ToString();
conn = new SQLConnection(strConn);
strSQL="select * from lanmu where id=" + intRecID.ToString();
dbComm=new SQLCommand(strSQL,conn);
dbComm.ActiveConnection.Open();
dbComm.Execute(out dbRead);
if(!dbRead.Read()){
showmsg.Text="对不起,没有编号为" + intRecID.ToString() + "的文章";
return;
}
//HttpServerUtility server=new HttpServerUtility();
showmsg.Text=Server.HtmlEncode(dbRead["content"].ToString());
}
</script>
<html>
<head>
<title>浏览文章__技术专栏__<%=sqlRead("title")%></title>
<%=GrabPage("/inc/head.inc")%>
<link rel="stylesheet" type="text/css" href="/doufu.css">
</head>
<body>
<asp:Label id=showmsg runat=server />
</body>
</html>


↑返回顶部   打印本页   关闭窗口↓  
收藏本文到:天极网摘 新浪VIVI 和讯网摘 博彩中心 365Key网摘 poco网摘 狐摘
亿友响享Yeeyoo igooi-it网摘 5seek网摘 I2Key 我摘网摘 天下图摘 YouNote 百特门
用户名: 新注册) 密码: 匿名评论 [所有评论]
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
设计服务 | 广告投放 | 友情链接 | 关于本站 | 联系我们 | 版权声明 | 设为首页 | 加入收藏