asp中如何实现点击新闻标题链接到新闻具体的内容?包括接收页的代码如何写? 10
<%DimRepeat1__numRowsDimRepeat1__indexRepeat1__numRows=28Repeat1__index=0ruichang_num...
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 28
Repeat1__index = 0
ruichang_numRows = ruichang_numRows + Repeat1__numRows
%>
<!--#include file="Connections/ruichang.asp" -->
<%
Dim ruichang
Dim ruichang_numRows
Set ruichang = Server.CreateObject("ADODB.Recordset")
ruichang.ActiveConnection = MM_ruichang_STRING
ruichang.Source = "SELECT * FROM news ORDER BY Time DESC"
ruichang.CursorType = 0
ruichang.CursorLocation = 2
ruichang.LockType = 1
ruichang.Open()
ruichang_numRows = 0
%>
<table border="0" cellpadding="0" cellspacing="0" width="980">
<tr>
<td colspan="3" rowspan="3" background="images/newbook/newsbook_r1_c1.gif"></td>
<td rowspan="3" background="images/newbook/newsbook_r1_c4.gif"></td>
<td colspan="3" background="images/newbook/newsbook_r1_c5.gif"></td>
<td><img src="images/newbook/spacer.gif" width="1" height="12" border="0" alt="" /></td>
</tr>
<tr>
<td></td>
<td ></td>
<td>></td>
</tr>
<tr>
<td colspan="3" background="images/newbook/newsbook_r3_c5.gif"></td>
<td><img src="images/newbook/spacer.gif" width="1" height="8" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="4" background="images/newbook/newsbook_r4_c1.gif"></td>
<td valign="top"rowspan="3" background="images/newbook/newsbook_r4_c2.gif">
<%
While ((Repeat1__numRows <> 0) AND (NOT ruichang.EOF))
%>
<img src="images/shuangjiantou001.gif" width="12" height="11">
<a href="newsbook_dongtai.asp?id=<%=ruichang("id")%>">
<%if len(ruichang.Fields.Item("title").Value)>7 then
response.Write left(ruichang.Fields.Item("title").Value,7)&"..."
else
response.Write ruichang.Fields.Item("title").Value
end if %></a><br>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
ruichang.MoveNext
Wend
%>
</td>
<td rowspan="3" background="images/newbook/newsbook_r4_c3.gif"></td>
<td align="center" colspan="3" background="images/newbook/newsbook_r4_c4.gif">
</td>
<td rowspan="4" background="images/newbook/newsbook_r4_c7.gif"></td>
<td><img src="images/newbook/spacer.gif" width="1" height="45" border="0" alt="" /></td>
</tr>
<tr>
<td align="center"colspan="3" background="images/newbook/newsbook_r5_c4.gif">发布时间: 发布人:</td>
<td><img src="images/newbook/spacer.gif" width="1" height="29" border="0" alt="" /></td>
</tr>
<tr>
<td valign="top"colspan="3" background="images/newbook/newsbook_r6_c4.gif"> </td>
<td><img src="images/newbook/spacer.gif" width="1" height="632" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="5" background="images/newbook/newsbook_r7_c2.gif"></td>
<td><img src="images/newbook/spacer.gif" width="1" height="15" border="0" alt="" /></td>
</tr>
</table>
<%
ruichang.Close()
Set ruichang = Nothing
%> 展开
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 28
Repeat1__index = 0
ruichang_numRows = ruichang_numRows + Repeat1__numRows
%>
<!--#include file="Connections/ruichang.asp" -->
<%
Dim ruichang
Dim ruichang_numRows
Set ruichang = Server.CreateObject("ADODB.Recordset")
ruichang.ActiveConnection = MM_ruichang_STRING
ruichang.Source = "SELECT * FROM news ORDER BY Time DESC"
ruichang.CursorType = 0
ruichang.CursorLocation = 2
ruichang.LockType = 1
ruichang.Open()
ruichang_numRows = 0
%>
<table border="0" cellpadding="0" cellspacing="0" width="980">
<tr>
<td colspan="3" rowspan="3" background="images/newbook/newsbook_r1_c1.gif"></td>
<td rowspan="3" background="images/newbook/newsbook_r1_c4.gif"></td>
<td colspan="3" background="images/newbook/newsbook_r1_c5.gif"></td>
<td><img src="images/newbook/spacer.gif" width="1" height="12" border="0" alt="" /></td>
</tr>
<tr>
<td></td>
<td ></td>
<td>></td>
</tr>
<tr>
<td colspan="3" background="images/newbook/newsbook_r3_c5.gif"></td>
<td><img src="images/newbook/spacer.gif" width="1" height="8" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="4" background="images/newbook/newsbook_r4_c1.gif"></td>
<td valign="top"rowspan="3" background="images/newbook/newsbook_r4_c2.gif">
<%
While ((Repeat1__numRows <> 0) AND (NOT ruichang.EOF))
%>
<img src="images/shuangjiantou001.gif" width="12" height="11">
<a href="newsbook_dongtai.asp?id=<%=ruichang("id")%>">
<%if len(ruichang.Fields.Item("title").Value)>7 then
response.Write left(ruichang.Fields.Item("title").Value,7)&"..."
else
response.Write ruichang.Fields.Item("title").Value
end if %></a><br>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
ruichang.MoveNext
Wend
%>
</td>
<td rowspan="3" background="images/newbook/newsbook_r4_c3.gif"></td>
<td align="center" colspan="3" background="images/newbook/newsbook_r4_c4.gif">
</td>
<td rowspan="4" background="images/newbook/newsbook_r4_c7.gif"></td>
<td><img src="images/newbook/spacer.gif" width="1" height="45" border="0" alt="" /></td>
</tr>
<tr>
<td align="center"colspan="3" background="images/newbook/newsbook_r5_c4.gif">发布时间: 发布人:</td>
<td><img src="images/newbook/spacer.gif" width="1" height="29" border="0" alt="" /></td>
</tr>
<tr>
<td valign="top"colspan="3" background="images/newbook/newsbook_r6_c4.gif"> </td>
<td><img src="images/newbook/spacer.gif" width="1" height="632" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="5" background="images/newbook/newsbook_r7_c2.gif"></td>
<td><img src="images/newbook/spacer.gif" width="1" height="15" border="0" alt="" /></td>
</tr>
</table>
<%
ruichang.Close()
Set ruichang = Nothing
%> 展开
3个回答
展开全部
你的程序我没看
具体的思路是这样的
首先你的标题是读取数据库的对吧 数据库中有个与之对应的新闻 而你点击新带运闻标题时在打开个新网页不就行了
而那个新网页中显蠢携梁示你的数据库中对应的新隐颤闻内容 那里面具体怎么排版就不需要我多说了吧
你觉得行你就试试
具体的思路是这样的
首先你的标题是读取数据库的对吧 数据库中有个与之对应的新闻 而你点击新带运闻标题时在打开个新网页不就行了
而那个新网页中显蠢携梁示你的数据库中对应的新隐颤闻内容 那里面具体怎么排版就不需要我多说了吧
你觉得行你就试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<%
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open "SELECT 字段名,id
FROM 表名
id="& request.QueryString(锋拆桐"id")&"银坦//接受传递过来御咐的id
%>
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.Open "SELECT 字段名,id
FROM 表名
id="& request.QueryString(锋拆桐"id")&"银坦//接受传递过来御咐的id
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询