473,800 Members | 3,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Previous and Next coding

9 New Member
I have a previous page and next page coded. The next page works. The previous page gives me an http: 404 error and I can't figure it out. The error is on the line "<td align=left>

Expand|Select|Wrap|Line Numbers
  1. <!--
  2.     This is the "previous" button.
  3.     This retrieves the previous page of documents for the query.
  4. -->
  5.  
  6. <%SaveQuery = FALSE%>
  7. <%if CurrentPage > 1 and RS.RecordCount <> -1 then 
  8.     <td align=left>
  9.         <form action="<%= QueryForm%>" method="POST">
  10.             <INPUT TYPE="HIDDEN" NAME="SearchString" VALUE="<%=SearchString%>">
  11.             <INPUT TYPE="HIDDEN" name="pg" VALUE="<%=CurrentPage-1%>" >
  12.  
  13.             <input type="submit" value="Previous <%=RS.PageSize%> documents">
  14.         </form>
  15.     </td>
  16.     <%SaveQuery = TRUE%>
  17. <%end if%>
  18.  
  19. <!--
  20.     This is the "next" button.
  21.     This button retrieves the next page of documents for the query.
  22.     If the RS.RecordCount is available, the number of
  23.     documents on the next page will be displayed.
  24. -->
  25.  
  26. <%if Not RS.EOF then%>
  27.     <td align=right>
  28.         <form action="<%= QueryForm%>" method="POST">
  29.             <INPUT TYPE="HIDDEN" NAME="SearchString" VALUE="<%=SearchString%>">
  30.             <INPUT TYPE="HIDDEN" name="pg" VALUE="<%=CurrentPage+1%>" >
  31.  
  32.             <% NextString = "Next "
  33.                if RS.RecordCount <> -1 then
  34.                    NextSet = (RS.RecordCount - NextRecordNumber) + 1
  35.                    if NextSet > RS.PageSize then
  36.                        NextSet = RS.PageSize
  37.                    end if
  38.                    NextString = NextString & NextSet & " documents"
  39.                else
  40.                    NextString = NextString & " page of documents"
  41.                end if
  42.              %>
  43.             <input type="submit" value="<%=NextString%>">
  44.         </form>
  45.     </td>
  46.     <%SaveQuery = TRUE%>
  47. <%end if%>
Oct 1 '07 #1
3 1891
markrawlingson
346 Recognized Expert Contributor
<%SaveQuery = FALSE%>
<%if CurrentPage > 1 and RS.RecordCount <> -1 then
<td align=left>
<form action="<%= QueryForm%>" method="POST">
<INPUT TYPE="HIDDEN" NAME="SearchStr ing" VALUE="<%=Searc hString%>">
<INPUT TYPE="HIDDEN" name="pg" VALUE="<%=Curre ntPage-1%>" >

<input type="submit" value="Previous <%=RS.PageSize% > documents">
</form>
</td>
<%SaveQuery = TRUE%>
<%end if%>
You're missing an ASP ending Delimiter (%>) at the end of the second line shown above ("<%if CurrentPage > 1 and RS.RecordCount <> -1 then"). The error is thrown on the TD tag because your ASP block is still open, so it's looking at the TD tag as part of your ASP code and trying to compile it.

Hope this helps,
Sincerely,
Mark
Oct 1 '07 #2
md9108
9 New Member
Thank you. I guess looking for the obvious is to easy.
Oct 2 '07 #3
markrawlingson
346 Recognized Expert Contributor
Happens to the best of us when you're sitting there staring at something for long periods of time.. it helps to have an extra set of eyes once in a while!
Oct 2 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
10988
by: george | last post by:
Can anyone help? I query a database and return a result on the column "reference". There might be 7 listings. Each row is displayed in a table, with links through to a detail page. I am working on having a "previous" record and a "next" record link on the detail page. This code below works, for the "next" record, by searching the values in the array $myarray for the variable $ref. It then returns the key value and the key value, as a...
5
9481
by: Bob Bedford | last post by:
Does exist a next prev function in PHP/Mysql. I've a website with returns lot of records (say about 200). The user may browse trough the list or returned records, but he has to click the record result then click back's browser in order to see the next record. I'd like to provide a "see next" and "see previous" record in the details itself. How to do so ? Bob
3
3058
by: Marcel | last post by:
Hello, I'm working on a search application for my website. The website contains a lot of pictures, and a search should return clickable thumbnails. No problems there. My problem started when I wanted to build in NEXT and PREVIOUS buttons, so that you only get 5 or 10 or 20 (I haven't made up my mind yet) thumbnails at a time. I use a SQL LIMIT statement to achieve that. After displaying the first 5 pictures I would like to see the next 5,...
24
2860
by: Ian Rastall | last post by:
I do a site where I have a previous and next link at the bottom of every page. It looks like: <p><a href="foo01.html">Previous</a> | <a href="foo03.html">Next</a></p> Seeing as they're always in sequential order, is there a way to automagically go to the previous file or the next file using JS? Ian --
3
1798
by: dekern | last post by:
Good afternoon all, I guess I am missing the benefit of using datasets with Crystal. For years I have written wrapper apps that used the Pull method and I let Crystal do all the sql work. Now I have an issue where the queries run for 4+ minutes so I don't want Crystal doing repeated legwork. I was under the impression that once the DataSet is filled and bound to the report the report (crystalviewer) would not need to re-run the...
6
2017
by: gwenna | last post by:
I have problem. I am reading a text file using a streamreader and I want to check if a field in the line I'm reading is the same as one in the line previously read before doing something but .. when the line I'm reading is the first line, I get an error... How can I check that the previous line exists? So far I have
1
2404
by: patronise | last post by:
My problem is that I'm wrestling to make the LoadMovie and UnloadMovie functions work for me. Here is the layout of my flash file: I've got several seperate flash files and I can jump to any one of them by pressing a specific key to load another flash file. Here is the code I'm using for this bit: Now when the next flash file is loaded, I use this bit of code to get rid of the previous flash file. Now this does work in getting...
3
1866
by: ITAutobot25 | last post by:
Now this is really the last problem (for real now) with this assignment. My sorter is not working. I managed to sort by product name in my previous assignment; however, I can't get it to work on this one. I changed things around so much in the program that I'm lost on how to get it going again. I also blocked that part of the code off with delimiters; I didn't want it to interfere with program import java.awt.BorderLayout; import...
3
3098
by: bhupesh8525 | last post by:
please help me thank to you in advance
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7574
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.