真晕了,怎么会这样,难道哪里看错了?
<!--#include file="conn.asp"-->
<%
URL=Request.ServerVariables("URL")
Set rs = server.CreateObject("adodb.recordset")
sql = "select * from book order by id desc"
rs.Open sql, db, 1, 1
Dim pagenum
rs.pagesize = 10
pagecount1 = rs.pagecount
If request.querystring("pagenum") = 0 Or request.querystring("pagenum") = "" Then
pagenum = 1
Else
pagenum = request("pagenum")
rs.absolutepage = Trim(request("pagenum"))
End If
%>
<table border=1>
<%Do While Not rs.EOF And i < rs.pagesize%>
<tr align="center">
<td height="26"><%=rs("bookname")%></td>
</tr>
<%
i = i + 1
rs.movenext
Loop
%>
</table>
<select name="go" onChange='window.location=go.options[go.selectedIndex].value'>
<%
for i=1 to pagecount1
if i=pagenum then%> '此处直接用数字没问题,用此变量就不行了
<option value=<%=url%>?pagenum=<%=i%> selected>第<%=i%>页</option>
<%else%>
<option value=<%=url%>?pagenum=<%=i%>>第<%=i%>页</option>
<%end if
next
%>
</select>
</table>
<%response.write pagenum%> '此处输出的值是正确的,显示为当前面页数.
没见过样变量不起用的.