我做的查询结果分页为什么在下一页时传的参数得不到植呢???

monimm 2003-11-30 03:01:17
我做的查询结果分页为什么在下一页时传的参数得不到植呢???
...全文
67 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
whb147 2003-12-06
  • 打赏
  • 举报
回复
建议用session保留参数,我是这么认为地
要不就用隐藏输入框
whghwujx 2003-12-04
  • 打赏
  • 举报
回复
俺也正在为这个问题苦恼,第一页没有问题,下一页就错误了,原因是前一页面提交的数据没有再继续传递,郁闷!
各位老大帮忙了,谢谢!
不知道楼主现在解决了没有!
俺的妹妹:whghwujx@eyou.com
哪位老大有好的资料给俺一份,谢谢先!
monimm 2003-11-30
  • 打赏
  • 举报
回复
老大帮我看看啊,调了3天了。
monimm 2003-11-30
  • 打赏
  • 举报
回复
<form method="post" action="fkbd_result.asp">
<table width="100%" border="0" cellspacing="1" cellpadding="0" height="89">
<tr>
<td height="19" colspan="3" nowrap>
<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">
<tr>
<td width="27%" nowrap class=css >
<% call LastNextPage(maxpage,page,result_num,pp) %>
</td>
<td width="15%" nowrap> 

</td>
</tr>
</table>
</td>
</tr>
<tr >
<td height="55" colspan="3" bgcolor="#FFFFFF">
<table width="100%" border="1" bordercolordark="#FFFFFF" bordercolorlight="#999999" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" height="50" class="css">
<tr bgcolor="#f4f4f4">
<td width="18%" height="20">招聘职位</td>
<td width="9%">人数</td>
<td width="18%">招聘部门</td>
<td width="18%">起始日期</td>
<td width="18%">招聘要求</td>
<td width="19%">在线应聘</td>
</tr>

<% if not rs.eof then %>
<% for i=1 to rs.PageSize %>
<tr class=p>
<td width="46%" nowrap height="25"><%=trim(rs.fields("Vacancy"))%></td>
<td width="9%" nowrap height="25"><%=trim(rs.fields("Persons"))%></td>
<td width="19%" nowrap height="25"> <%=trim(rs.fields("Depart"))%></td>
<td width="15%" nowrap height="25"> <%=trim(rs.fields("EndDate"))%></td>
<td width="15%" nowrap height="25"><a href=javascript:MM_openBrWindow('Position.asp?ID=<%= trim(rs.fields("ID"))%>') class=css>详细要求</a></td>
<td width="15%" nowrap height="25"><a href="zpxx.asp?id=<%= trim(rs.fields("ID"))%>" class="css">在线应聘</a></td>

</tr>


<%
rs.movenext:if rs.EOF then Exit For
next
end if
%>
</table>
</td>
</tr>
</table>
</form>
monimm 2003-11-30
  • 打赏
  • 举报
回复
<%
response.expires=0
dim action,ss
Sub LastNextPage(pagecount,page,resultcount,ss)
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")

query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next

Response.Write("<table cellspacing=0 cellpadding=0 border=0 class=word>" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
Response.write ("<input type=hidden name=pp1 value='"& ss &"'>" & vbCrLf )
Response.Write("<TD align=right>" & vbCrLf )
' Response.Write(font_style & vbCrLf )

if page<=1 then
Response.Write ("分页:首页 " & vbCrLf)
Response.Write ("上一页 " & vbCrLf)
else
Response.Write(">>分页:<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & "&" & ss & ">上一页</A> " & vbCrLf)
end if

if page>=pagecount then
Response.Write ("下一页 " & vbCrLf)
Response.Write ("尾页" & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & "&" & ss & ">下一页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A>" & vbCrLf)
end if

Response.Write(" 第" & "<INPUT style=""HEIGHT: 19px;font-size: 12px""TYEP=TEXT NAME=page SIZE=2 Maxlength=5 VALUE=" & page & ">" & "页" & vbCrLf & "<INPUT type=submit style=""HEIGHT: 19px;font-size: 12px"" value=GO>")
Response.Write(" 共 " & pageCount & " 页" & vbCrLf)
Response.Write(" " & resultcount & " 条信息" & vbCrLf)
Response.Write("</TD>" & vbCrLf )
Response.Write("</TR></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
%>
<%

if not isobject(Session("connection")) then
Response.write "<a href=""../default.asp"" target=_top>超时或登录不正确,请重新登录!</a>"
Response.End
end if
Dim strSQL,strField,strScriptName
Dim cnn, rst
Set cnn = Session("connection")

if instr(ucase(request.ServerVariables("HTTP_REFERER")),"NEWS_VIEW")=0 then

if Request.ServerVariables("REQUEST_METHOD") = "POST" then
dim c_type,PubTime,vacancy
c_type=trim(request("com_key"))
c_type1=request.querystring("com_key1")
PubTime=trim(request("news_date"))
vacancy=trim(request("zw_key"))
response.write c_type1


'按公司查询条件

if c_type="全部" then
strSQL = "where 1=1 "
else
strSQL = "select * from tblVacancy where c_type='"&c_type&"' "
end if


'按职位查询
if vacancy <>"" then
strSQL = strSQL & " and vacancy like '%"&vacancy&"%' "
end if
'按时间查询条件

select case PubTime
case "0"
strSQL = strSQL & " and PubTime = '" & date() & "'"
case "3"
strSQL = strSQL & " and PubTime > '" & DateAdd("d","-3",date()) & "'"
case "7"
strSQL = strSQL &" and PubTime > '" & DateAdd("d","-7",date()) & "'"
case "30"
strSQL = strSQL &" and PubTime > '" & Dateadd("d","-30",date()) & "'"
case "365"
strSQL = strSQL & " and PubTime > '" & Dateadd("d","-365",date()) & "'"
case ""
strSQL = strSQL
end select



'按排序查询条件

if request.form("sort") =0 then
strSQL = strSQL &" order by PubTime desc"
else
strSQL = strSQL &" order by PubTime asc"
end if



end if



end if
%>

<%
dim rs,thesql,page,pp
set rs=server.createobject("adodb.recordset")
thesql="select * from tblVacancy "

thesql=thesql &strSQL
response.write thesql
'response.end
if c_type="全部" and vacancy<>""then
pp=""&sql&""
else
pp="com_key1="& c_type &"&zw_key="&vacancy &""&sql&" "
end if

rs.open thesql,cnn,3,1
if rs.eof then
%>
<script language=javascript>
<!--
//window.alert("没有任何记录!")
//history.go(-1)
-->
</script>
<%
'response.end
end if

if not rs.eof then
rs.PageSize =1 '每页记录条数
result_num=rs.RecordCount '记录总数
maxpage=rs.PageCount
page=request("page")

if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if

if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
else
result_num=0
maxpage=0
page=0
end if
%>

woodwolf 2003-11-30
  • 打赏
  • 举报
回复
要看看你是用什么方法传的,附一下代码,
ljupin 2003-11-30
  • 打赏
  • 举报
回复
仔细检查:)没有代码不好说什么

28,407

社区成员

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

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