求教,高手指点一下喔.
我在做网站时!asp新闻标题做出来了!但是一点击显不出新闻内容!那位朋友指点一下新闻内容显示页怎么做!
谢谢!!!!!
下面是我做的asp新闻标题代码!!
<%
c&server.mappath("gaosu.mdb")
set conn=server.createobject("ADODB.CONNECTION")
conn.open connstr
function mytext(tempstr,tempwid)
if len(tempstr)>tempwid then
mytext=left(tempstr,tempwid)&"..."
else
mytext=tempstr
end if
end function
Sub CloseDataConn
If IsObject(Conn) Then:Conn.Close:Set Conn = Nothing:End If
End Sub
%>
<html>
<head>
<meta http-equiv="Content-Language" c>
<meta http-equiv="Content-Type" c>
<title>中国新闻</title>
</head>
<style type="text/css">
<!--
.unnamed11 { font-family: "宋体";
font-size: 12px;
color: #000000;
line-height: 20px;
}
.unnamed21 { font-family: "宋体";
font-size: 12px;
color: #007000;
line-height: 24px;
}
.style5 {color: #CE3108}
.style6 {color: #CC0000}
-->
</style>
<body>
<div align="center">
<table border="0" width="800" id="table1">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="47%">
<table border="0" width="100%" id="table2">
<tr>
<td bgcolor="#FF0000">
<p align="center"><font color="#FFFF00">中国新闻</font></td>
</tr>
<tr><% sql="SELECT top 3 * from (SELECT * from news where du=71 ORDER BY ID DESC)"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write " <tr> <td >暂无新闻</td></tr>"
else
do while not rs.eof
%>
<td> <a href="viewnews.asp?newsid=<%=rs("id")%>&classid=<%=rs("du")%>" title="<%=rs("bt")%>" target="_blank"><span class="style6">·</span><%=left(rs("bt"),17)%> </a></td>
</tr><%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
</table>
</td>
<td width="2%"> </td>
<td width="47%">
<table border="0" width="100%" id="table3">
<tr>
<td bgcolor="#FF0000">
<p align="center"><font color="#FFFF00">新闻动态</font></td>
</tr>
<tr><% sql="SELECT top 3 * from (SELECT * from news where du=72 ORDER BY ID DESC)"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write " <tr> <td >暂无新闻</td></tr>"
else
do while not rs.eof
%>
<td><a href="viewnews.asp?newsid=<%=rs("id")%>&classid=<%=rs("du")%>" title="<%=rs("bt")%>" target="_blank"><span class="style6">·</span><%=left(rs("bt"),17)%> </a> </td>
</tr><%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
</table>
</td>
</tr>
</table>
</div>
<p> </p>
<p> </p>
<div align="center">
<table border="0" width="800" id="table4">
<tr>
<td bgcolor="#FF0000">
<p align="center"><font color="#FFFF00">专题新闻</font></td>
</tr>
<tr><% sql="SELECT top 3 * from (SELECT * from news where du=73 ORDER BY ID DESC)"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write " <tr> <td >暂无新闻</td></tr>"
else
do while not rs.eof
%>
<td> <a href="viewnews.asp?newsid=<%=rs("id")%>&classid=<%=rs("du")%>" title="<%=rs("bt")%>" target="_blank"><span class="style6">·</span><%=left(rs("bt"),17)%> </a></td>
</tr><%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
</table>
</div>
</body>
</html>
[[italic] 本帖最后由 gaosugonglu 于 2007-12-5 11:18 编辑 [/italic]]