主题:【求助】高手近来看看
我写了段程序
<% Option Explicit %>
<!--#Include file="conn5.asp"-->
<html>
<head>
<title>LIST</title>
</head>
<body>
<h2 align="center">产品价格</h2>
<center>
<form method="post" action="">
<table bgcolor="#CCCCCC">
<tr>
<td>产品名称关键字:</td><td><input type="text" name="ProductName" size="20"></td>
<td><input type="submit" value="确 定"></td>
</tr>
</table>
</form>
<table border="1" width="90%">
<tr>
<td>ID</td>
<td>产品名称</td>
<td>类型</td>
<td>库存量</td>
<td >市场价</td>
<td bgcolor="#CCCCCC">商城价</td>
<td>会员价</td>
</tr>
<%
if Trim(Request("ProductName"))<>"" then
Dim sql,rs
set rs=Server.CreateObject("ADODB.Recordset")
sql="select ProductID,ProductName,ProductType,Stocks,Price_Market,Price_Original,Price_Member From Pe_product where ProductName like'%"&Trim(Request("ProductName"))&"%' "
rs.Open sql,db,1,3
If Not rs.Bof And Not rs.Eof Then
dim page_size
dim page_no
dim page_total
page_size=30
If Request("page_no")="" then
page_no=1
else
page_no=Cint(Request.QueryString("page_no"))
End if
rs.PageSize=page_size
page_total=rs.PageCount
rs.AbsolutePage=page_no
dim I
I=page_size
Do while Not rs.EOF And I>0
I=I-1
%>
<tr align="center">
<td width="30"><%=rs("ProductID")%></td>
<td align="left" width="400"><%=rs("ProductName")%></td>
<td width="50"><%=rs("ProductType")%></td>
<td width="70"><%=rs("Stocks")%></td>
<td width="70"><%=rs("Price_Market")%></td>
<td width="70" bgcolor="#CCCCCC"><%=rs("Price_Original")%></td>
<td width="70"><%=rs("Price_Member")%></td>
</tr>
<%
rs.MoveNext
Loop
%>
</table>
<%
response.write"请选择页码:"
for I=1 to page_total
if I=page_no then
response.write I & " "
else
response.write "<a href=list5.asp?page_no=" & I & ">" & I & "</a> "
End if
next
End if
End if
%>
</center>
</body>
</html>
输入关键字后只能显示第一页的内容,点击第二页就不能显示了
<% Option Explicit %>
<!--#Include file="conn5.asp"-->
<html>
<head>
<title>LIST</title>
</head>
<body>
<h2 align="center">产品价格</h2>
<center>
<form method="post" action="">
<table bgcolor="#CCCCCC">
<tr>
<td>产品名称关键字:</td><td><input type="text" name="ProductName" size="20"></td>
<td><input type="submit" value="确 定"></td>
</tr>
</table>
</form>
<table border="1" width="90%">
<tr>
<td>ID</td>
<td>产品名称</td>
<td>类型</td>
<td>库存量</td>
<td >市场价</td>
<td bgcolor="#CCCCCC">商城价</td>
<td>会员价</td>
</tr>
<%
if Trim(Request("ProductName"))<>"" then
Dim sql,rs
set rs=Server.CreateObject("ADODB.Recordset")
sql="select ProductID,ProductName,ProductType,Stocks,Price_Market,Price_Original,Price_Member From Pe_product where ProductName like'%"&Trim(Request("ProductName"))&"%' "
rs.Open sql,db,1,3
If Not rs.Bof And Not rs.Eof Then
dim page_size
dim page_no
dim page_total
page_size=30
If Request("page_no")="" then
page_no=1
else
page_no=Cint(Request.QueryString("page_no"))
End if
rs.PageSize=page_size
page_total=rs.PageCount
rs.AbsolutePage=page_no
dim I
I=page_size
Do while Not rs.EOF And I>0
I=I-1
%>
<tr align="center">
<td width="30"><%=rs("ProductID")%></td>
<td align="left" width="400"><%=rs("ProductName")%></td>
<td width="50"><%=rs("ProductType")%></td>
<td width="70"><%=rs("Stocks")%></td>
<td width="70"><%=rs("Price_Market")%></td>
<td width="70" bgcolor="#CCCCCC"><%=rs("Price_Original")%></td>
<td width="70"><%=rs("Price_Member")%></td>
</tr>
<%
rs.MoveNext
Loop
%>
</table>
<%
response.write"请选择页码:"
for I=1 to page_total
if I=page_no then
response.write I & " "
else
response.write "<a href=list5.asp?page_no=" & I & ">" & I & "</a> "
End if
next
End if
End if
%>
</center>
</body>
</html>
输入关键字后只能显示第一页的内容,点击第二页就不能显示了