| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 405 人关注过本帖
标题:高手请进 ASP如何实现动态标题 如下
只看楼主 加入收藏
kingdows
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2011-4-19
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
高手请进 ASP如何实现动态标题 如下
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="pagination.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<title>新闻中心<%=SiteTitle%></title>
<meta name="keywords" content="<%=site_info("keywords")%>" />
<meta name="description" content="<%=site_info("description")%>" />
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0.5)">
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0.5)" >
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css/css.css" type=text/css rel=stylesheet>
<style type="text/css">
#center{ width:850px;}
#center .bf2{ width:850px; margin:0; height:604px;}
#center .bf2 .xprx{ width:850px;}
#center .bf2 .zs{ width:850px; height:550px; margin:0 auto; padding-top:20px;}

</style>
</head>
<body>
<div id="head">
   <div class="logo"><img src="images/logo.jpg" width="1005" height="69" border="0" usemap="#Map"/>
   
     <map name="Map" id="Map">
      <area shape="rect" coords="678,33,803,52" href="http://www. />
      <a onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.');" href="http://www. shape="rect" coords="810,33,866,51" href="#" /></a>
      <a href="#" onclick="javascript:window.external.AddFavorite('http://www.','盛高')" title="收藏本站到你的收藏夹"><area shape="rect" coords="877,33,935,50" href="#" /></a>
      <area shape="rect" coords="944,33,1000,51" href="lxwm.html" />
    </map>
  
  </div>
</div>
<div id="fla">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=      "http://download.,0,29,0" width="1005" height="33">
             <param name="movie" value="banner.swf" />
             <param name="quality" value="high" />
             <embed src="banner.swf" width="1005" height="33" quality="high" pluginspage="http://www. type="application/x-shockwave-flash"></embed>
            </object>
</div>
<div id="fla1">


    <div id="index_left" style="width:1005px; height:300px;">
        <div class="index_flash">
            <script type=text/javascript>
            var pic_width=1005; //图片宽度
            var pic_height=300; //图片高度
            var button_pos=4; //按扭位置 1左 2右 3上 4下
            var stop_time=4000; //图片停留时间(1000为1秒钟)
            var show_text=0; //是否显示文字标签 1显示 0不显示
            var txtcolor="000000"; //文字色
            var bgcolor="DDDDDD"; //背景色
            var imag=new Array();
            var link=new Array();
            var text=new Array();
            imag[1]="images/1.jpg";
            link[1]="/#";
            text[1]="FinePix F85EXR";
            imag[2]="images/2.jpg";
            link[2]="/#";
            text[2]="FinePix F85EXR";
            imag[3]="images/3.jpg";
            link[3]="/#";
            text[3]="S 系列";
            imag[4]="images/4.jpg";
            link[4]="/#";
            text[4]="Z 系列";
            imag[5]="images/5.jpg";
            link[5]="/#";
            text[5]="FinePix XP11";
            
            //可编辑内容结束
            var swf_height=show_text==1?pic_height+20:pic_height;
            var pics="", links="", texts="";
            for(var i=1; i<imag.length; i++){
                pics=pics+("|"+imag[i]);
                links=links+("|"+link[i]);
                texts=texts+("|"+text[i]);
            }
            pics=pics.substring(1);
            links=links.substring(1);
            texts=texts.substring(1);
            document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.,0,0,0" width="'+ pic_width +'" height="'+ swf_height +'">');
            document.write('<param name="movie" value="images/focus.swf">');
            document.write('<param name="quality" value="high"><param name="wmode" value="opaque">');
            document.write('<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'">');
            document.write('<embed  wmode="transparent"  src="images/focus.swf" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&pic_width='+pic_width+'&pic_height='+pic_height+'&show_text='+show_text+'&txtcolor='+txtcolor+'&bgcolor='+bgcolor+'&button_pos='+button_pos+'&stop_time='+stop_time+'" quality="high" width="'+ pic_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www. />');
            document.write('</object>');
            </script>
        </div>
        </div>
</div>
<div id="main" style="height:inherit; line-height:20px;  ">
        <table width="80%" border="0" cellpadding="0" cellspacing="0" align="center">
<%
set rs = server.createobject("adodb.recordset")
curid=request.QueryString("id")
sql = "UPDATE news SET hit = hit + 1 WHERE id = " + cstr(curid)
conn.execute sql
sql = "SELECT * FROM news WHERE id = " + cstr(curid)
rs.open sql,conn,1,1
%>
      <tr>
        <td align="center" class="TitleRight2"><%=rs("title")%></td>
      </tr>
      <tr>
        <td align="center" class="TitleRight2">来源:<%=rs("source")%> 作者:<%=rs("author")%> 日期:<%=rs("data")%> 浏览次数:<%=rs("hit")%></td>
      </tr>
      <tr>
        <td height="1" class="TitleRight1"></td>
      </tr>
      <tr>
        <td class="Content"><%=ContentPagination(rs("body"))%></td>
      </tr>
      <tr><td>
        <%
        Dim rsnp, next_title, previous_title
        Set rsnp = server.CreateObject("adodb.recordset")
        rsnp.Open "select top 1 id, title from news where id>" & request.QueryString("id") & " order by id asc", conn, 1, 1
        If Not rsnp.EOF Then
            next_title = "<a href=""news_view.asp?id=" & rsnp(0) & """>" & rsnp(1) & "</a>"
        Else
            next_title = "暂无"
        End If
        rsnp.Close
        rsnp.Open "select top 1 id, title from news where id<" & request.QueryString("id") & " order by id desc"
        If Not rsnp.EOF Then
            previous_title = "<a href=""news_view.asp?id=" & rsnp(0) & """>" & rsnp(1) & "</a>"
        Else
            previous_title = "暂无"
        End If
        rsnp.Close
        Set rsnp = Nothing
        %>
        <p>上一条新闻:<%=previous_title%>&nbsp;&nbsp;
        下一条新闻:<%=next_title%></p>
      </td></tr>
    </table>


<!--#include file="footer.asp"-->


</body>
</html>
搜索更多相关主题的帖子: content PUBLIC 新闻中心 
2011-04-19 20:41
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
收藏
得分:20 
如果你不想在<head><title>标签里设置的话,在<body>中用下面的代码也可以
<script language="JavaScript" type="text/javascript">
document.title="<%=rs("title")%>"
</script>
 

----我怎能在别人的苦难面前转过脸去----
2011-04-20 09:07
快速回复:高手请进 ASP如何实现动态标题 如下
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.066866 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved