The above ASP code rs15.asp, uses the browser in the client side, browses the execution result, displays the previous article the function.
The bookmark (bookmark) Position of the user's recordset is stored by the session ("bookmark"), and when the [previous] super connection is pressed, the <a href=rs15.asp?sel=prev> the previous one </a The SEL is set to Prev and the rs15.asp ASP code is executed again. The following program section first sets the Bookmark property to the name of the set bookmark ("Bookmark"), returns to the location of the last bookmark, and then uses MovePrevious to move to the previous position:
If Request ("sel") = "Prev" Then
Rs2. Bookmark = Session ("Bookmark")
Rs2. MovePrevious
ElseIf Request ("sel") = "Next" Then
Rs2. Bookmark = Session ("Bookmark")
Rs2. MoveNext
End If
Session ("Bookmark") = rs2. Bookmark
Then use the session ("Bookmark") = rs2. The bookmark is set, and the session ("bookmark") stores the name of the bookmark mark.
When the [next] super connection is pressed, the <a href=rs15.asp?sel=next> the next </a>, sets the sel to next, and executes the rs15.asp ASP code again. From the above program section, return to the location of the last bookmark, and then use MoveNext to move to the next position.
The position of the bookmark is displayed by <% = Session ("Bookmark")%> Note that the position of the first record is not 0 but 1792, so we have to get the bookmark position value of the first and the end to determine whether to display the [previous] [next] super connection.
In order to determine whether to display [previous] [next] super connection, by the following program part, we set two bookmarks, by Bkstart = rs2. Bookmark sets the position of the first article by Bkend = Rs2. Bookmark + rs2. RecordCount-1 set the position of the end bar:
<%
SQLSTR = "SELECT * from"
Rs2. Open sqlstr,conn1,1,1
Bkstart = rs2. Bookmark
Bkend = rs2. Bookmark + rs2. RecordCount-1
If session ("Bookmark") > Bkstart then%>
<a href=rs15.asp?sel=prev> on a piece of </A>
<% End If%>
<% if session ("Bookmark") < Bkend then%>
<a href=rs15.asp?sel=next> Next </A>
<% End If%>
You can use the IF session ("bookmark") > Bkstart, the If session ("bookmark") < Bkend to compare the current position session ("bookmark") and the first Bkstart, The end of the Bkend position to determine if you want to display a hyperlink to [previous] [next].
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.