asp动态获取id传递链接,不同链接弹出的页面,总是显示同一个ID(内容相同),源码见下面。
<!--#includefile="inc/conn.asp"--><!--#includefile="inc/Page.asp"--><html><head><titl...
<!--#include file="inc/conn.asp" -->
<!--#include file="inc/Page.asp" -->
<html>
<head>
<title>新闻浏览页面</title>
<script type="text/javascript" src="jquery.js"></script><script type="text/javascript" src="log.js"></script>
<link href="inc/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from xinwen order by ID desc"
rs.open sql,conn,3,1
if rs.eof and rs.bof then
response.write "无记录"
else
dim currentpage,page_count,Pcount
dim totalrec,endpage
Const sm=10
if request("page")="" or not isnumeric(request("page")) then
currentPage=1
else
currentPage=cint(request("page"))
end if
perpage=sm
rs.PageSize=perpage
rs.AbsolutePage=currentpage
page_count=0
totalrec=rs.recordcount
%>
<table width="390" height="20" border="1" align="center" cellspacing="0" bordercolor="#999999" style="border-collapse:collapse;">
<tr class="unnamed2" align="center">
<td width="62" height="20"><strong>姓名</strong></td>
<td width="110"><strong>编号</strong></td>
<td width="150"><strong>部门</strong></td>
<td width="50"><strong>年份</strong></td>
</tr>
<%
while (not rs.eof) and (not page_count=rs.PageSize)
%>
<script type="text/javascript">
// 个人信息
var demoDG1;
function opdg1(){
demoDG1 = $.dialog({ id:'demo_1', title:'总结详情', content:'url:ppes/xinwen_xq.asp?id=<%=rs("id")%>' });};
</script>
<tr class="unnamed3">
<td><div align="center"><%=rs("录入者")%></div></td>
<td><div align="center"><a href="javascript:" class="runcode" id="demo_1" onClick="opdg1();"><%=rs("编号")%></span></a></div></td>
<td><div align="center"><%=rs("部门")%></div></td>
<td><div align="center"><%=rs("年份")%></div></td>
</tr>
<%
page_count=page_count+1
rs.movenext
wend
%>
</table>
<br>
<div class="manu" align="center"><%Call FenYePage("class=""disabled""","class=""current""")
end if
rs.close
set rs=nothing%>
</div>
</body></html>
aa 展开
<!--#include file="inc/Page.asp" -->
<html>
<head>
<title>新闻浏览页面</title>
<script type="text/javascript" src="jquery.js"></script><script type="text/javascript" src="log.js"></script>
<link href="inc/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from xinwen order by ID desc"
rs.open sql,conn,3,1
if rs.eof and rs.bof then
response.write "无记录"
else
dim currentpage,page_count,Pcount
dim totalrec,endpage
Const sm=10
if request("page")="" or not isnumeric(request("page")) then
currentPage=1
else
currentPage=cint(request("page"))
end if
perpage=sm
rs.PageSize=perpage
rs.AbsolutePage=currentpage
page_count=0
totalrec=rs.recordcount
%>
<table width="390" height="20" border="1" align="center" cellspacing="0" bordercolor="#999999" style="border-collapse:collapse;">
<tr class="unnamed2" align="center">
<td width="62" height="20"><strong>姓名</strong></td>
<td width="110"><strong>编号</strong></td>
<td width="150"><strong>部门</strong></td>
<td width="50"><strong>年份</strong></td>
</tr>
<%
while (not rs.eof) and (not page_count=rs.PageSize)
%>
<script type="text/javascript">
// 个人信息
var demoDG1;
function opdg1(){
demoDG1 = $.dialog({ id:'demo_1', title:'总结详情', content:'url:ppes/xinwen_xq.asp?id=<%=rs("id")%>' });};
</script>
<tr class="unnamed3">
<td><div align="center"><%=rs("录入者")%></div></td>
<td><div align="center"><a href="javascript:" class="runcode" id="demo_1" onClick="opdg1();"><%=rs("编号")%></span></a></div></td>
<td><div align="center"><%=rs("部门")%></div></td>
<td><div align="center"><%=rs("年份")%></div></td>
</tr>
<%
page_count=page_count+1
rs.movenext
wend
%>
</table>
<br>
<div class="manu" align="center"><%Call FenYePage("class=""disabled""","class=""current""")
end if
rs.close
set rs=nothing%>
</div>
</body></html>
aa 展开
1个回答
展开全部
<!--#include file="inc/conn.asp" -->
<!--#include file="inc/Page.asp" -->
<html>
<head>
<title>新闻浏览页面</title>
<script type="text/javascript" src="jquery.js"></script><script type="text/javascript" src="log.js"></script>
<link href="inc/css.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from xinwen order by ID desc"
rs.open sql,conn,3,1
if rs.eof and rs.bof then
response.write "无记录"
else
dim currentpage,page_count,Pcount
dim totalrec,endpage
Const sm=10
if request("page")="" or not isnumeric(request("page")) then
currentPage=1
else
currentPage=cint(request("page"))
end if
perpage=sm
rs.PageSize=perpage
rs.AbsolutePage=currentpage
page_count=0
totalrec=rs.recordcount
%>
<table width="390" height="20" border="1" align="center" cellspacing="0" bordercolor="#999999" style="border-collapse:collapse;">
<tr class="unnamed2" align="center">
<td width="62" height="20"><strong>姓名</strong></td>
<td width="110"><strong>编号</strong></td>
<td width="150"><strong>部门</strong></td>
<td width="50"><strong>年份</strong></td>
</tr>
<%
while (not rs.eof) and (not page_count=rs.PageSize)
%>
<script type="text/javascript">
// 个人信息
var demoDG<%=rs("id")%>;
function opdg<%=rs("id")%>(){
demoDG<%=rs("id")%> = $.dialog({ id:'demo_<%=rs("id")%>', title:'总结详情', content:'url:ppes/xinwen_xq.asp?id=<%=rs("id")%>' });};
</script>
<tr class="unnamed3">
<td><div align="center"><%=rs("录入者")%></div></td>
<td><div align="center"><a href="javascript:" class="runcode" id="demo_<%=rs("id")%>" onClick="opdg<%=rs("id")%>();"><%=rs("编号")%></span></a></div></td>
<td><div align="center"><%=rs("部门")%></div></td>
<td><div align="center"><%=rs("年份")%></div></td>
</tr>
<%
page_count=page_count+1
rs.movenext
wend
%>
</table>
<br>
<div class="manu" align="center"><%Call FenYePage("class=""disabled""","class=""current""")
end if
rs.close
set rs=nothing%>
</div>
</body></html>
不过你这弄个链接也用到jquery,简直是“高射炮打蚊子”!如果直接用a标签,代码可以简化几倍
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询