当前位置: 移动技术网 > IT编程>开发语言>.net > ASP进阶之文章在线管理更新(8)

ASP进阶之文章在线管理更新(8)

2019年01月17日  | 移动技术网IT编程  | 我要评论

河北唐山邮政编码,斗破拳皇,萝莉御姐吸奶的动漫

asp进阶之文章在线管理更新--主页面及搜索篇

作者:沙滩小子

   经过了文章的添加、保存、显示,那么现在应该来谈谈关于管理程序的显示主页面,也就是显示所有文章的标题连接,以方便浏览者查找文章,其应该具有的功能有:显示所有文章的标题连接,加入日期,浏览次数等信息,另外还必须提供分页功能,要不然这么多的文章标题在一个页面都显示出来,那将非常的费时且不便浏览,另外由于本程序在这里结合了文章分栏目搜索的功能,所以在这里也将一起介绍了。

   下面就为大家详细的介绍主页面index.的这些功能的实现过程以及其具体功用:

   "建立连接
<!--#include file="conn.asp"-->
<html>

<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>asp专题栏目</title>
<meta name="generator" content="microsoft frontpage 3.0">
<link rel="stylesheet" type="text/css" href="style.css">
<script language="javascript">
function popwin2(path)
{ window.open(path,"","height=450,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}
</script>
</head>
<%

   "定义每页最大文章标题显示量maxperpage,你可以自己修改这里的数字来达到你的最佳显示效果
   const maxperpage=18
   dim totalput   
   dim currentpage
   dim totalpages
   dim i,j

   "假如返回的页面信息是空的,也就是如果你直接输入index.asp,那么就用这里定义的页数第一页
   if not isempty(request("page")) then
      currentpage=cint(request("page"))
   else
      currentpage=1
   end if
   dim sql
   dim rs
   dim rstype
   dim typesql
   dim typeid,typename

   "如果返回的栏目信息为空,那么就用这里定义的栏目,这里指定的是第三个栏目
   if not isempty(request("typeid")) then
typeid=request("typeid")
   else
typeid=3
   end if

   "通过返回的栏目typeid号,打开数据库显示指定的栏目,并把其值交给typename
set rstype=server.createobject("adodb.recordset")
  typesql="select * from type where typeid="&cstr(typeid)
  rstype.open typesql,conn,1,1
  typename=rstype("type")
  rstype.close
%>

<body>
<p align="center"><center>

<table border="0" width="95%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" style="border-left: thin dotted rgb(0,128,0); border-right: thin dotted rgb(0,128,0)"><p align="center"><br>

   "显示栏目信息,当你点击了任何一个栏目,在typename的位置都会显示相关信息,这里没有采用栏目的自动显示方式是考虑了页面的显示效果,而采用手工添加的模式,要想采用自动模式,就自己写吧:)相信你学习到现在,不会连这个都编不出来吧!
    动网asp技巧专题&gt;&gt;<font color="#ff0000"><%response.write ""&typename&""%></font><br>
    <a href="index.asp?typeid=1">asp faq</a>|<a href="index.asp?typeid=2">asp</a> |<a href="index.asp?typeid=3">asp文摘</a>|<a href="index.asp?typeid=4">asp实例</a>|<a href="index.asp?typeid=5">asp安全</a> </p>

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网