asp分页:第一页没问题,但是按别的按钮(首页,下一页等)就会变成搜索全部
" onfocus="this.value=''" onblur="if(!value){value=defaultValue;}">这是搜索框的代码
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<% dim bigname,sname
sqlnews="select * from product where title like '%"&request("keyword")&"%'"
set rss=server.CreateObject("adodb.recordset")
rss.open sqlnews,conn,3,3
set rs=getrecordset(sqlnews)
if not ( rs.eof and rs.bof ) then
bigname=rs("bigclassname")
sname=rs("smallclassname")
%>
这是查询代码
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
这是分页代码
" name="gotopage" class="f12 STYLE2" id="gotopage">
<%if rsrecordcount="" then
showcount=0
else
showcount=rsrecordcount
end if
%> 总共有<%=showcount%>张图片
<%
if (rsrecordcount mod rspagesize)=0 then
allpage=int(Cint(rsrecordcount)/rspagesize)
else
allpage=int(Cint(rsrecordcount)/rspagesize)+1
end if
if allpage=0 then
allpage=1
end if
showpages=1
if not isempty(request("page")) then
titlepage=Cint(request("page"))
showpages=Cint(titlepage/rspagesize)+1
end if
if showpages=0 then
showpages=1
end if
%>
第<%=showpages%>/<%=allpage%>页
<%if page>=0 then%>
?page=0&bigclassname=<%=request("bigclassname")%>&title=<%=request("keyword")%>">首页
<%else%>
首页
<%end if%>
<% if page>1 then %>
?page=<%=page-rspagesize%>&bigclassname=<%=request("bigclassname")%>&title=<%=request("keyword")%>">上页
<%else%>
上页
<%end if%>
<% if page
?page=<%=page+rspagesize%>&bigclassname=<%=request("bigclassname")%>&title=<%=request("keyword")%>">下页
<%else%>
下页
<%end if%>
<%if page
?page=<%=rspagecount*rspagesize%>&bigclassname=<%=request("bigclassname")%>&title=<%=request("keyword")%>">尾页
<%else%>
尾页
<%end if %>
" />" />
<%
if request("page")<>"" then
crruectpage=Cint(request("page"))
%>
" selected="selected">第<%=Int(crruectpage/rspagesize)+1%>页
<%end if%>
<%
i=0
do while i
" >第<%=i+1%>页
<% i=i+1
loop %>