![]() |
#2
孤独冷雨2010-01-09 17:04
<!--#include file="conn.asp"-->
<% dim worktype,p worktype=request.QueryString("worktype") if worktype="" then %> <table align="center" border="0" cellpadding="0" cellspacing="0"> <tr> <td><b>欢迎使用管理系统</b></td> </tr> </table> <% elseif worktype="add" then%> <% elseif worktype="mody" then set rs=server.CreateObject("adodb.recordset") sql="select * from aa order by texttime desc" rs.open sql,conn,1,1 if rs.eof then response.write"没有内容" else rs.pagesize=2 page=Clng(request("page")) if page<1 then page=1 if page>rs.recordcount then page=rs.recordcount rs.absolutepage=page %> ......中间是表单 <table width="600" align="center" border="0" cellpadding="5" cellspacing="0"> <%for n=1 to rs.pagesize%> <tr> <td><%=rs("texttopic")%></td> <td><a href="update.asp?id=<%=rs("id")%>">编辑</a></td> <td><a href="delete.asp?id=<%=rs("id")%>">删除</a></td> </tr> <% rs.movenext if rs.eof then exit for next %> <tr> <td><%if p<>1 then%><a href="mody.asp?worktype=<%=worktype%>&page=1">第一页</a> <a href="mody.asp?worktype=<%=worktype%>&page=<%=page-1%>">上一页</a> <%end if%></td> <td> <%if p<>rs.pagecount then%> <a href="mody.asp?worktype=<%=worktype%>&page=<%=page+1%>">下一页</a> <a href="mody.asp?worktype=<%=worktype%>&page=<%=rs.pagecount%>">最后一页</a> <%end if%> </td> </tr> </table> <%end if end if %> |

谢谢各位高手指教下~~
<!--#include file="conn.asp"-->
<%
dim worktype,p
worktype=request.QueryString("worktype")
p=request.QueryString("page")
if p="" then
p=1
end if
if worktype="" then
%>
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><b>欢迎使用管理系统</b></td>
</tr>
</table>
<%
elseif worktype="add" then%>
<% elseif worktype="mody" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from aa order by texttime desc"
rs.open sql,conn,1,1
rs.pagesize=2
if p>rs.pagecount then
p=rs.pagecount
end if
if not rs.eof then
rs.absolutepage=int(p)
end if
%>
......中间是表单
<table width="600" align="center" border="0" cellpadding="5" cellspacing="0">
<%for n=1 to rs.pagesize%>
<tr>
<td><%=rs("texttopic")%></td>
<td><a href="update.asp?id=<%=rs("id")%>">编辑</td>
<td><a href="delete.asp?id=<%=rs("id")%>">删除</td>
</tr>
<%
rs.movenext
if rs.eof then
exit for
end if
next
%>
<tr>
<td><%if p>1 then%><a href="mody.asp?worktype=<%=worktype%>&page=1">第一页</a>
<a href="mody.asp?worktype=<%=worktype%>&page=<%=p-1%>">上一页</a>
<%end if%></td>
<td>
<%if p<rs.pagecount then%>
<a href="mody.asp?worktype=<%=worktype%>&page=<%=p+1%>">下一页</a>
<a href="mody.asp?worktype=<%=worktype%>&page=<%=rs.pagecount%>">最后一页</a>
<%end if%>
</td>
</tr>
</table>
<%end if
%>