求救 asp 分页和页面跳转?

tyx214586 2006-03-10 04:26:05
在文本框输入想要进去的页面,通过按钮来实现。
sql="select * from call_board where kind="&kind&" order by createtime desc"
rs.open sql,conn,1,1
callname=getcallname(kind)

sz=20
rs.pagesize=sz
totalpage=cint(rs.recordcount\sz)
if rs.recordcount mod sz >0 then totalpage=totalpage+1
if request("page")< "1" or request("page")= "" then
page=1
else
page=cint(request("page"))
end if
if not rs.eof then rs.AbsolutePage=page
%>

</font> <div align="right"><font color="#003399">共<SPAN class=hr1><%= totalpage %></SPAN>页 第<SPAN class=hr1><%= Page %></SPAN>页
<%if Page>1 then%>
<A class=a02 href="?page=<%=Page-1%>&kind=<%=kind%>">
<%end if%>
上一页</A>
<input name="keyword" type="hidden" id="keyword" value="<%=Request("keyword")%>">
<input name="kind" type="hidden" id="kind" value="<%=Request("kind")%>">

<input name="Page" type="text" id="Page" value="<%=Request("Page")%>" size="5">

<input type="submit" name="Submit" value="Go">

<%if Page<totalpage then%>
<A class=a02 href="?page=<%=Page+1%>&kind=<%=kind%>">
<%end if%>
下一页
怎么点击没有反应?
...全文
105 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
star591 2006-03-24
  • 打赏
  • 举报
回复
我也被搞晕了!
tyx214586 2006-03-10
  • 打赏
  • 举报
回复
不明白。。。因为我刚学ASP。。还不怎么会。
tyx214586 2006-03-10
  • 打赏
  • 举报
回复
sql="select * from call_board where kind="&kind&" order by createtime desc"
rs.open sql,conn,1,1
callname=getcallname(kind)
sz=20
rs.pagesize=sz
totalpage=cint(rs.recordcount\sz)
if rs.recordcount mod sz >0 then totalpage=totalpage+1
if request("page")< "1" or request("page")= "" then
page=1
else
page=cint(request("page"))
end if
if not rs.eof then rs.AbsolutePage=page


<font color="#003399">  </font> <div align="right"><font color="#003399">
<%if Page>1 then%>
<a href = ?page=<%=Page-1%>&kind=<%=kind%>>上一页</a>
<%Else%>
上一页
<%End IF%>
|
<%if Page<totalpage then%>
<a href = ?page=<%=Page+1%>&kind=<%=kind%>>下一页</a>
<%Else%>
<font style='color:#999999'>下一页</font>
<%End IF%><%=cint(page)%>/<%=Rs.pagecount%>页 共<%=Rs.recordcount%>个
<form name="form" method="post" action=""> 第 
<input type=text name="Page" value="<%=Request("Page")%>" size=4 maxlength=5 style="BORDER-RIGHT: silver 1px solid #aaaaaa; BORDER-TOP: silver 1px solid; BORDER-LEFT: silver 1px solid; background-color:ffffff; height:13pt;width:20pt; COLOR: black; border-color:#aaaaaa; border-bottom: silver 1px solid #aaaaaa;font-size:9pt;">
 
<input type="submit" name="submit" value="go" >
<input name="type" type="hidden" id="type" value="<%=request("type")%>"></form>



</font> </div>
什么都不能 2006-03-10
  • 打赏
  • 举报
回复
参数不完整,你最好把那几个隐藏域先改为可见文本框,问题解决了再隐藏它们,这样你可以看到他们的值的变化
tyx214586 2006-03-10
  • 打赏
  • 举报
回复
还有一个问题,就是一开始点GO有用,但是在点击下一页或者上一页的时候,点GO就仍然在当前页,不跳转了
什么都不能 2006-03-10
  • 打赏
  • 举报
回复
当然没有反应了
第一,你的submit按钮没有<form标签,第二没有事件,你能让它做什么呢?
tyx214586 2006-03-10
  • 打赏
  • 举报
回复
恩。点GO也不能传递那个值。。还是在第一页。。不会跳转
tyx214586 2006-03-10
  • 打赏
  • 举报
回复
还是不行啊。。不能取文本框的值,点GO没反应
什么都不能 2006-03-10
  • 打赏
  • 举报
回复
你的<form标签呢?是不是丢了?
R_Kill 2006-03-10
  • 打赏
  • 举报
回复
<input type="submit" name="submit" value="go" style="font-size:9pt">
<input name="type" type="hidden" id="type" value="<%=request("type")%>">
   <%=cint(page)%>/<%=Rs.pagecount%>页 共<%=Rs.recordcount%>个
<script language=JavaScript>
<!--

function Juge(theForm)
{
if ( theForm.page.value=="" || isNaN(theForm.page.value) || theForm.page.value > <%=Rs.pagecount%> || theForm.page.value < 1)
{
alert("对不起,请输入不大于 <%=Rs.pagecount%> 的数字!");
theForm.page.value = "<%=Rs.pagecount%>";
theForm.page.select();
return (false);
}
}

//-->
</script>

28,391

社区成员

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

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