永发信息网

帮我看看这段代码

答案:2  悬赏:30  手机版
解决时间 2021-07-30 12:04
  • 提问者网友:留有余香
  • 2021-07-30 07:35

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include virtual="/Connections/shilian.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_shilian_STRING
Recordset1.Source = "SELECt * FROM shiliandechaxun"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<table width="80%" height="13" border="0" cellpadding="0" cellspacing="0">

<tr>
<td height="13"><a href="/shilian/show.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>"><%=(Recordset1.Fields.Item("biaoti").Value)%></a></td>
</tr>
</table>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
重点是这一句<td height="13"><a href="/shilian/show.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>"><%=(Recordset1.Fields.Item("biaoti").Value)%></a></td>
我想达到的目的就是我点击标题的时候可以自动跳转到对应标题的那一页。

那一页该怎么写?只要教我怎么调用前一页发过来的请求就可以了,成了我加分

最佳答案
  • 五星知识达人网友:鱼芗
  • 2021-07-30 08:58
id=trim(Request.querystring("id"))
全部回答
  • 1楼网友:夜风逐马
  • 2021-07-30 10:10

在show.asp这个页面获取一下id值

string getid = Request.QueryString["id"].ToString(); string str = "select * from 表名 where id=" + getid;

试试,不懂再问我,给我分吧,呵呵。

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯