求ASP新闻显示内容代码!
index页面代码如下:<%dowhilenotrs.eofresponse.write"<li><ahref=news.asp?ID="&Rs("ID")&"targe...
index页面代码如下:
<%do while not rs.eof
response.write"<li><a href=news.asp? ID="& Rs("ID") &" target=_blank>"
response.Write "<span>"& rs("addtime")&"</span>"
if len (rs ("title"))>10 then response.Write left (rs("title"),8) & "..." else response.Write rs("title")
response.write "</a></li>"
rs.movenext
loop
%>
现在我求NEWS页面代码,求高手帮忙一下,我已经搞了很多天,实在没有办法! 展开
<%do while not rs.eof
response.write"<li><a href=news.asp? ID="& Rs("ID") &" target=_blank>"
response.Write "<span>"& rs("addtime")&"</span>"
if len (rs ("title"))>10 then response.Write left (rs("title"),8) & "..." else response.Write rs("title")
response.write "</a></li>"
rs.movenext
loop
%>
现在我求NEWS页面代码,求高手帮忙一下,我已经搞了很多天,实在没有办法! 展开
2个回答
展开全部
给你一段代码,刚写的,测试成功!!呵呵^^^
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<HEAD>
<style type="text/css">
<!--
body {
background-image: url(img/2-t1.gif);
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style3 {color: #ECE9D8}
.style4 {
font-size: 12px;
color: #FF0000;
}
.style5 {
color: #000000;
font-size: 16px;
font-weight: bold;
}
.style6 {
font-size: 12px;
color: #333333;
}
-->
</style>
<TITLE>新闻查看系统</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\mycs\mdb\db1.mdb")
exec ="select * from xwfb where id="&Request("id")
set rs=server.CreateObject("adodb.recordset")
rs.open exec,conn,1,3
%>
<link href="xinwen.css" rel="stylesheet" type="text/css">
</HEAD>
<body>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" class="style5">新 闻 中 心</td>
</tr>
<tr>
<td align="center"> </td>
</tr>
</table>
<table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td align="center"><table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center" class="wenzi2"><%=rs("biaoti")%></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center" class="style6">发布时间: <%=rs("time")%></td>
</tr>
</table><hr>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" bgcolor="#d0e8f9" class="wenzi2"> <%=rs("neirong")%></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td align="center" class="style3"><a href="javascript:window.close();" class="style4">关闭窗口</a></td>
</tr>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<HEAD>
<style type="text/css">
<!--
body {
background-image: url(img/2-t1.gif);
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style3 {color: #ECE9D8}
.style4 {
font-size: 12px;
color: #FF0000;
}
.style5 {
color: #000000;
font-size: 16px;
font-weight: bold;
}
.style6 {
font-size: 12px;
color: #333333;
}
-->
</style>
<TITLE>新闻查看系统</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\mycs\mdb\db1.mdb")
exec ="select * from xwfb where id="&Request("id")
set rs=server.CreateObject("adodb.recordset")
rs.open exec,conn,1,3
%>
<link href="xinwen.css" rel="stylesheet" type="text/css">
</HEAD>
<body>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" class="style5">新 闻 中 心</td>
</tr>
<tr>
<td align="center"> </td>
</tr>
</table>
<table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr>
<td align="center"><table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center" class="wenzi2"><%=rs("biaoti")%></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td align="center" class="style6">发布时间: <%=rs("time")%></td>
</tr>
</table><hr>
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" bgcolor="#d0e8f9" class="wenzi2"> <%=rs("neirong")%></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
</tr>
<tr>
<td align="center" class="style3"><a href="javascript:window.close();" class="style4">关闭窗口</a></td>
</tr>
</table>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询