View Full Version : Hoe to Add a Previour Button
victoria_1018
09-27-2002, 07:25 AM
Hi all, I had just finished a search engine program. Every thing works well except the previous link. Does anyone know how should I create the previous link.
I had attached my codes together with this request.
Thanks
Victoria
glenngv
09-27-2002, 07:39 AM
if you were able to make the Next button, why can't you make the Previous button? It's pretty much the same, just the other way around.
victoria_1018
09-27-2002, 07:46 AM
I had tried creating the Previous using the below method and it work exactly like the Next button. I had try other methods and it give the same result. I am not very sure how to make it work backward.
<a href="SearchUnsuccessfulResult.asp?NAV=<%=iPage - 1%>&LastID=<%=iLastID%>">Next >></a>
Thanks
webmarkart
09-27-2002, 03:02 PM
nothing fancy about this, but it will take you back one page...
<A HREF="javascript:history.go(-1)">Go Back</A>
victoria_1018
09-27-2002, 04:12 PM
webmarkart ,
Thanks I will try it out.
regards
victoria
aCcodeMonkey
09-27-2002, 04:56 PM
Victoria,
There is a "little" more advanced method of walking thru recordsets called "Recordset Paging" that is better suited for displaying search results.
This method works with what is called "disconnected recordsets".
basically the recordset is streamed to the browser. You can then manipulate the recordset as needed. The method also has the advantage of not requerying the database everytime it is processed on the webserver. Thus reducing stress on the database and faster page refresh.
Here ia a good article from ASP 101
Recordset Paging with ADO 2.0 (http://www.asp101.com/articles/recordsetpaging/index.asp)
or take a look in ASP Help.com (http://www.asp-help.com/)
The attached file is an example of how I present a log I maintain in a SQL 2000 database which manages a web portal.
The example code is very good in that it contains code for:
Alternating table row colors
Conditional highlighting
Changing the number of results displayed
Displaying the current page number & total pages
:thumbsup:
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.