一个调用相同页面传参啊

xjxb21 2006-06-09 09:30:47
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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" />
<!--#include file="../asp/testserch.asp"-->
<!--#include file="../asp/getproperty.asp"-->
<!--#include file="../Artist/init_news.asp"-->
<%
dim pnow
pnow=request("pnow")
%>
<title>无标题文档</title>
</head>

<body style="margin:0px">
<table width="763" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr>
<td width="347" rowspan="2" valign="top">
<%
dim i
for i=(pnow*3-3) to (i+2) '参数2表示每页显示3=(2+1)条新闻记录
response.Write i
%>
<%next%>
</td>
<td width="416" height="56"> </td>
</tr>
<tr>
<td height="379" valign="top" background="/Pictures/Introduction_Back.jpg"><!--DWLayoutEmptyCell--> </td>
</tr>


<tr>
<td height="29" colspan="2" valign="top">
<!--设置每页显示 3 条新闻信息-->

<a>第 <% response.Write cstr(pnow) %> 页</a>

<a>共 <% response.Write Cint(page_count/3) %> 页</a>

<a href="/Artist/news.asp?pnow=1">首页</a>

<a>上一页</a>

<a href="/Artist/news.asp?pnow=<%=pnow+1%>">下一页</a>

<a>尾页</a>
</td>
</tr>
</table>
</body>
</html>




dim i
for i=(pnow*3-3) to (i+2) '参数2表示每页显示3=(2+1)条新闻记录
response.Write i

假如我传入的参数pnow初始化为1,这句语句出现的结果是正确的,如果我把点击“下一页”的时候。就没有显示了呢?也不报错, 我相信 <!--#include file="../asp/testserch.asp"-->
<!--#include file="../asp/getproperty.asp"--><!--#include file="../Artist/init_news.asp"-->是没有问题的,

大虾救命啊!~~一定要救我

...全文
143 13 打赏 收藏 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
xjxb21 2006-06-09
  • 打赏
  • 举报
回复
解决拉 谢谢大家 谢谢jackrose() jinfeng003(小高手) 谢谢你们,,循环语句和PNOW变形后就可以拉 哈哈 谢谢~~~:)
jinfeng003 2006-06-09
  • 打赏
  • 举报
回复
for i=(pnow*3-3) to (i+2)


这个循环也改一下
for i=(pnow*3-3) to pnow*3-1
jinfeng003 2006-06-09
  • 打赏
  • 举报
回复
改一下开头
dim pnow
pnow=clng(request("pnow"))

然后再用pnow试试看
尽量不要用CInt,我见过几个版本的IIS不支持
xjxb21 2006-06-09
  • 打赏
  • 举报
回复
试了,和以前一样,只可以点首页的时候有数字出现,而点下一页又什么也没有。。。。
jackrose 2006-06-09
  • 打赏
  • 举报
回复
其实我也学了不久``呵呵``我们彼此彼此!
xjxb21 2006-06-09
  • 打赏
  • 举报
回复
怎么不说话拉啊 久久我啊
jackrose 2006-06-09
  • 打赏
  • 举报
回复
<%
dim i
for i=(pnow*3-3) to (i+2)'参数2表示每页显示3=(2+1)条新闻记录
response.Write i
%>
看这段 你用变量pnow参与了运算,你在它前面加上Cint()
如:
<%
dim i
p=Cint(pnow)

for i=(p*3-3) to (i+2)
response.write i
%>
xjxb21 2006-06-09
  • 打赏
  • 举报
回复
好象没运算,,,不知道怎么写 请举个例子好么?小弟刚学不久,不太懂。。拜托你拉
jackrose 2006-06-09
  • 打赏
  • 举报
回复
那就是你传过去的值是字符串,而你用它进行比较或运算了吗??
xjxb21 2006-06-09
  • 打赏
  • 举报
回复
我只想让大家在我发的代码里面看看,别的我认为是真确的,而且我也在其他页面用过
xjxb21 2006-06-09
  • 打赏
  • 举报
回复
jackrose() 我不是这个意思啊。我的是文件操作。不是数据库的啊,我是FSO的。。。晕。我想知道我传入的参数为什么会丢失呢 ?而显示 第X页 却是好的。。。。
xjxb21 2006-06-09
  • 打赏
  • 举报
回复
怎么没人相救呀。。。。我急~!!!!拜托大家拉
jackrose 2006-06-09
  • 打赏
  • 举报
回复
你可以用这种方法进行分页```
<%
rs.pagesize=3 '每页显示3条新闻信息
dim pnow
pnow=request("pnow")
if pnow="" then
pnow=1
else
if Cint(pnow<1) then pnow=1 end if
if Cint(pnow>rs.pagecount) then pnow=rs.pahecount end if
end if
rs.absolutepage=pnow
%>
<title>无标题文档</title>
</head>

<body style="margin:0px">
<table width="763" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr>
<td width="347" rowspan="2" valign="top">
<%
dim i
for i=1 to rs.pagesize '从1开始循环到页面的显示值
response.Write () '想显示的内容
next%>
</td>
<td width="416" height="56"> </td>
</tr>
<tr>
<td height="379" valign="top" background="/Pictures/Introduction_Back.jpg"><!--DWLayoutEmptyCell--> </td>
</tr>


<tr>
<td height="29" colspan="2" valign="top">
<!--设置每页显示 3 条新闻信息-->

<a>第 <%=cint(pnow)%> 页</a>

<a>共 <%=Cint(rs.pagecount)%> 页</a>

<a href="/Artist/news.asp?pnow=1">首页</a>

<a>上一页</a>

<a href="/Artist/news.asp?pnow=<%=pnow+1%>">下一页</a>

<a>尾页</a>
</td>
</tr>
</table>

28,402

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧