主题:  有个分页探测需要求救!

江湖中的宝贝

职务:普通成员
等级:2
金币:1.0
发贴:375
#12004/2/17 13:31:42
<%
dim z
z=rs.pagecount
if page=1 then
response.write "<a href=edit.asp?page="&(page+1)&">下页</a>&nbsp;&nbsp;<a href=edit.asp?page="&z&">最后一页</a>"
end if
if page=z then
response.write "<a href=edit.asp?page="&(page-1)&">上页</a>&nbsp;&nbsp;<a href=edit.asp?page=1>第一页</a>"
end if
if page<>1
response.write "<a href=edit.asp?page=1>第一页</a><a href=edit.asp?page="&(page-1)&">上页</a>&nbsp;<a href=edit.asp?page="&(page+1)&">下页</a>&nbsp;&nbsp;<a href=edit.asp?page="&rs.pagecount&">最后一页</a>"
end if
%>


这个探测页面的写法,我好像写错了,总是运行错误,不规范,我想过用选择语句写,但是还是不会,怎么写各位前辈提醒一下!



wangchang

职务:普通成员
等级:1
金币:0.0
发贴:1
#22004/4/19 15:35:53
<%
first="<a href='edit.asp?class="&Recordset1__MMColParam&"&types="&types&"&page=1'>[首页]</a>"
back="<a href='edit.asp?class="&Recordset1__MMColParam&"&types="&types&"&page="&page-1&"'>[上一页]</a>"
come="<a href='edit.asp?class="&Recordset1__MMColParam&"&types="&types&"&page="&page+1&"'>[下一页]</a>"
last="<a href='edit.asp?class="&Recordset1__MMColParam&"&types="&types&"&page="&pagecounts&"'>[尾页]</a>"
go=" 跳转到第 <input name='page' type='text' size='2'> 页 <input type='submit' name='Submit' value='go'>"                        
response.write"<table width='100%' border='0' cellpadding='0' cellspacing='0'>"
response.write"<tr><td width='183' height='39' align='left' valign='middle'>&nbsp;页次:"&page&"/"&pagecounts&" </td>"                        
response.write"<form method='post' action='edit.asp?class="&Recordset1__MMColParam&"&types="&types&"' onsubmit='return check(this);'><td width='340' align='right'><br>"
if pagecounts>1 then
if page=1 then
response.write "[首页][上一页]"&come&last&go&"&nbsp;&nbsp;&nbsp;"
     elseif (page>1)and(Cint(page)<pagecounts) then
         response.write first&back&come&last&go&"&nbsp;&nbsp;&nbsp;"
             elseif Cint(page)=pagecounts then
                 response.write first&back&"[下一页][尾页]""         
end if
end if
response.write"</form></td></tr></table>"                
                        end if                         
                        %>



绿茶

职务:普通成员
等级:8
金币:10.0
发贴:19267
#32004/4/20 15:44:51

    [共 <%=rs.recordcount%> 条记录,第 <font color="#FF0000"> <%=page%> </font>           
    / <%=rs.pagecount%> 页]                        
<%
if page=1 then 
	response.write "[首页|上一页" 
else 
	response.write "[<a href="&url&"&page=1>首页</a>|<a href="&url&"&page="&page-1&">上一页</a>" 
end if 

if page=rs.pagecount or rs.recordcount=0 then 
	response.write "|下一页|尾页]" 
else 
	response.write "|<a href="&url&"&page="&page+1&">下一页</a>|<a href="&url&"&page="&rs.pagecount&">尾页</a>]"
end if 
%>
                          &nbsp;转到第                         
                          <input type="text" name="page" size="1" >
                          页                         
                          <input name="submit" type="submit" value="go">