CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  Web 开发 >  ASP

生成静态页??? 急 急

楼主wsyzh()2006-11-04 13:47:12 在 Web 开发 / ASP 提问

请问有将新闻系统的列表和详细转化为静态页的方法,,,,,,,,,,,急 问题点数:20、回复次数:5Top

1 楼loye(一天的时间)回复于 2006-11-04 13:58:29 得分 0

写个生成静态页面的程序好了,网上这种例子也多的是Top

2 楼apple__()回复于 2006-11-04 15:14:37 得分 0

关注Top

3 楼luxu001207(笨笨)回复于 2006-11-04 15:18:38 得分 0

网上这类代码N多.......Top

4 楼wsyzh()回复于 2006-11-04 15:25:49 得分 0

具体点.找了.没有详细的Top

5 楼hanpoyangtitan(韩波洋)回复于 2006-11-04 15:33:16 得分 0

字符串替换啊,  
  <!--#include   virtual="common/tools/class/template.inc"-->  
  <%  
  dim   str  
  template=new   TemplateCase  
  template.openFile("/template/newsList.html")   '加载静态模板  
  str=""  
  set   rs=server.createobject("adodb.recordset")  
          rs.open   "'pageList',"&pagesize&","&currentpage&","'id','status=1   and   category="&category&"   order   by   postdate   desc'",conn,1,1   '利用存储过程分页  
          while   not   rs.eof  
                  '简化了HTML代码  
                  str=str&"<li><div   style=""width:100px;float:left;""><a   href="""&rs("htmlurl")&"""   target="_self">&rs("title")&"</a></div><div   style=""width:50px;float:left"">"&rs("postdate")&"</div></li>"&vbcrlf  
                  rs.movenext  
          wend  
          rs.close  
          set   rs=conn.execute("select   count(id)   from   t_news   where   status=1   and   category="&category&"   order   by   postdate   desc")  
          dim   count                       '纪录总数  
          if   not   rs.eof   then  
                  count=rs(0)  
          end   if  
          str=str&getPageLink(currentPage,url,count)&vbcrlf   '统计数据,和分页链接  
          rs.close  
          set   rs=nothing  
          template.value=str  
          template.replaceTemplate("\$news_list\$")  
          template.saveTemplateAsFile("/news/html/news_list_"&currentpage&".html")  
  %>Top

相关问题

关键词

得分解答快速导航

  • 帖主:wsyzh

相关链接

  • Web开发类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo