So, user sees default results of products (sorted by price, 5 records
per page, and page number 1). If the user sorts by part number, it
will display sorted by part number, 5 records per page, still on page
1. If they then click on 25 items per page, the sort method (part
number) still happens, they receive 25 items per page, and are still
on page one. etc, etc, etc.
Does this information make sense? Thanks in advance.
Michael Baker
de...@inetware.net
You need to split your logic into two parts:
Part 1: initialising and setting various variables (sort order, page number,
records per page)
Part 2: constructing the resultset.
<%
Dim strSortBy ' Column to Sort by
Dim intPage ' the page to display
Dim intRecsPerPage ' records per page
intRecsPerPage = Request.QueryString("Recs")
intPage = Request.QueryString("Page")
strSortBy = Request.QueryString("SortBy")
If strSortBy <> "Field1" and strSortBy <> "Field2" then
' Set the default sort by
strSortBy = "Field1"
End If
If intRecsPerPage <> 5 and intRecsPerPage <> 10 then
intRecsPerPage = 5
End If
If not isNumeric(intPage) or Len(intPage & "") = 0 then
intPage = 1
Else
intPage = Abs(Int(intPage))
End If
' Now you have strSortBy, intPage and intRecsPagePage
' Apply your normal paging routines
Cheers
Ken
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Michael Baker" <de...@inetware.net> wrote in message
news:bac07508.02072...@posting.google.com...