| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 408 人关注过本帖
标题:请asp高手帮个忙
只看楼主 加入收藏
南海捍卫者
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-10-24
结帖率:0
收藏
已结贴  问题点数:20 回复次数:4 
请asp高手帮个忙
我想在自己的网站上做个滑动门菜单,滑动时显示各栏目的最新文章,但测试时打开网页非常慢,打开以后不能显示任何文章,请高手帮找找原因解决,不胜感谢。代码如下:
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style>
*{margin:0;padding:0;}
body{margin:0px;font-size:12px;color:#666;}
li{list-style:none;}
.list{width:400px;height:26px;padding:2px;font-size:12px;line-height:18px;border:1px #cfedff solid;border-top:0;}
.tab{width:400px;height:26px;border:1px #cfedff solid;border-bottom:0;background:#EBF7FF;}
.tab ul{margin:0;padding:0;}
.tab li{float:left;padding:0 16px;height:26px;line-height:26px;text-align:center;border-right:1px #ebf7ff solid;cursor:pointer;}
.tab li.now{color:#5299c4;background:#fff;font-weight:bold;}
.block{display:block;}
</style>
<head>
<script type="text/javascript">
function setTab(name,num,n){
    for(i=1;i<=n;i++){
        var menu=document.getElementById(name+i);
        var con=document.getElementById(name+"_"+"con"+i);
        menu.className=i==num?"now":"";
          con.style.display=i==num?"block":"none";
    }
}
</script>
</head>
<body>
    <div class="tab">
        <ul>
            <li id="one1" onMouseOver="setTab('one',1,4)" class="now">最近更新</li>
            <li id="one2" onMouseOver="setTab('one',2,4)">通知通报</li>
            <li id="one3" onMouseOver="setTab('one',3,4)">警示教育</li>
            <li id="one4" onMouseOver="setTab('one',4,4)">监管要闻</li>
        </ul>
    </div>
    <div class="list">
        <div id="one_con1">
            <div style=""><span>
         <%
Set Rs200=Conn.Execute("select top 6 * from "& db_EC_News_Table &" where checkked=1 and goodnews=1 order by newsid desc")
If Rs200.EOF Then
Response.Write "<li>·暂无更新</li>"
End if
Do While Not Rs200.EOF
If showyear=1 Then
  datetime="(" & year(rs200("UpdateTime"))  &"."& Month(rs200("UpdateTime"))  &"."& Day(rs200("UpdateTime")) &")"
else
  datetime="("& Month(rs200("UpdateTime"))  &"."& Day(rs200("UpdateTime")) &")"
end if
%>
<tr>
            <td  height="22" width="400">&nbsp;&nbsp;<img src="images/dd.gif" width="7" height="7">&nbsp;&nbsp;<a class="tj" target="_blank" href="E_ReadNews.asp?NewsId=<%=rs9("newsid")%>" title="<%=CutStr(nohtml(rs9("Content")),100)%>"> <%=CutStr(htmlencode4(title),34)%></a><%if year(rs9("updatetime"))=year(date()) and month(rs9("updatetime"))=month(date()) and day(date())-day(rs9("updatetime"))<2 then%>
            <img src="images/new.gif">
          <%end if%></td> </tr>
<%
Rs200.movenext
Loop
Rs200.Close
Set Rs200=Nothing
%>
</span></div>
        </div>
        <div id="one_con2" style="display:none;">
           <div style=""><span>
         <%
Set Rs201=Conn.Execute("select top 6 * from "& db_EC_News_Table &" where E_typeid=12 and checkked=1 and goodnews=1 order by newsid desc")
If Rs201.EOF Then
Response.Write "<li>·暂无更新</li>"
End if
Do While Not Rs201.EOF
If showyear=1 Then
  datetime="(" & year(rs201("UpdateTime"))  &"."& Month(rs201("UpdateTime"))  &"."& Day(rs201("UpdateTime")) &")"
else
  datetime="("& Month(rs201("UpdateTime"))  &"."& Day(rs201("UpdateTime")) &")"
end if
%>
<tr>
            <td  height="22" width="400">&nbsp;&nbsp;<img src="images/dd.gif" width="7" height="7">&nbsp;&nbsp;<a class="tj" target="_blank" href="E_ReadNews.asp?NewsId=<%=rs9("newsid")%>" title="<%=CutStr(nohtml(rs9("Content")),100)%>"> <%=CutStr(htmlencode4(title),34)%></a><%if year(rs9("updatetime"))=year(date()) and month(rs9("updatetime"))=month(date()) and day(date())-day(rs9("updatetime"))<2 then%>
            <img src="images/new.gif">
          <%end if%></td> </tr>
<%
Rs201.movenext
Loop
Rs201.Close
Set Rs201=Nothing
%>
</span></div>
        </div>
        <div id="one_con3" style="display:none;">
         <div style=""><span>
         <%
Set Rs202=Conn.Execute("select top 6 * from "& db_EC_News_Table &" where E_typeid=16 and checkked=1 and goodnews=1 order by newsid desc")
If Rs202.EOF Then
Response.Write "<li>·暂无更新</li>"
End if
Do While Not Rs202.EOF
If showyear=1 Then
  datetime="(" & year(rs202("UpdateTime"))  &"."& Month(rs202("UpdateTime"))  &"."& Day(rs202("UpdateTime")) &")"
else
  datetime="("& Month(rs202("UpdateTime"))  &"."& Day(rs202("UpdateTime")) &")"
end if
%>
<tr>
            <td  height="22" width="400">&nbsp;&nbsp;<img src="images/dd.gif" width="7" height="7">&nbsp;&nbsp;<a class="tj" target="_blank" href="E_ReadNews.asp?NewsId=<%=rs9("newsid")%>" title="<%=CutStr(nohtml(rs9("Content")),100)%>"> <%=CutStr(htmlencode4(title),34)%></a><%if year(rs9("updatetime"))=year(date()) and month(rs9("updatetime"))=month(date()) and day(date())-day(rs9("updatetime"))<2 then%>
            <img src="images/new.gif">
          <%end if%></td> </tr>
<%
Rs202.movenext
Loop
Rs202.Close
Set Rs202=Nothing
%></span></div>
        </div>
    </div>  
    <div id="one_con4" style="display:none;">
         <div style=""><span>
         <%
Set Rs203=Conn.Execute("select top 6 * from "& db_EC_News_Table &" where E_typeid=17 and checkked=1 and goodnews=1 order by newsid desc")
If Rs203.EOF Then
Response.Write "<li>·暂无更新</li>"
End if
Do While Not Rs203.EOF
If showyear=1 Then
  datetime="(" & year(rs203("UpdateTime"))  &"."& Month(rs203("UpdateTime"))  &"."& Day(rs203("UpdateTime")) &")"
else
  datetime="("& Month(rs203("UpdateTime"))  &"."& Day(rs203("UpdateTime")) &")"
end if
%>
<tr>
            <td  height="22" width="400">&nbsp;&nbsp;<img src="images/dd.gif" width="7" height="7">&nbsp;&nbsp;<a class="tj" target="_blank" href="E_ReadNews.asp?NewsId=<%=rs9("newsid")%>" title="<%=CutStr(nohtml(rs9("Content")),100)%>"> <%=CutStr(htmlencode4(title),34)%></a><%if year(rs9("updatetime"))=year(date()) and month(rs9("updatetime"))=month(date()) and day(date())-day(rs9("updatetime"))<2 then%>
            <img src="images/new.gif">
          <%end if%></td> </tr>
<%
Rs203.movenext
Loop
Rs203.Close
Set Rs203=Nothing
%></span></div>
        </div>
    </div>
</body>
</html>
搜索更多相关主题的帖子: include html content PUBLIC 
2012-10-24 10:57
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:10 
感觉你的Do While循环用的太多了,先检查<%%>内的代码是否正确吧
menu.className=i==num?"now":"";
而且你这个三元判断好像问题也不少
2012-10-24 11:42
南海捍卫者
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-10-24
收藏
得分:0 
以下是引用yms123在2012-10-24 11:42:49的发言:

感觉你的Do While循环用的太多了,先检查内的代码是否正确吧
menu.className=i==num?"now":"";
而且你这个三元判断好像问题也不少
我已经仔细研究了好几天了,找不到问题的根源在哪里,再叫我检查也查不出什么,如果三元判断有问题,是什么问题?能帮改改吗?
2012-10-24 22:57
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
收藏
得分:10 
代码中 rs9 是什么?是不是写错了?应该是 Rs200,201...这些吧

----我怎能在别人的苦难面前转过脸去----
2012-10-25 19:38
南海捍卫者
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-10-24
收藏
得分:0 
以下是引用dzt0001在2012-10-25 19:38:15的发言:

代码中 rs9 是什么?是不是写错了?应该是 Rs200,201...这些吧
是的,还是老兄仔细,我改改看行不行。
2012-10-26 10:19
快速回复:请asp高手帮个忙
数据加载中...
 
   



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

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