473,326 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Previous and Next coding

9
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 1863
markrawlingson
346 Expert 100+
<%SaveQuery = FALSE%>
<%if CurrentPage > 1 and RS.RecordCount <> -1 then
<td align=left>
<form action="<%= QueryForm%>" method="POST">
<INPUT TYPE="HIDDEN" NAME="SearchString" VALUE="<%=SearchString%>">
<INPUT TYPE="HIDDEN" name="pg" VALUE="<%=CurrentPage-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
Thank you. I guess looking for the obvious is to easy.
Oct 2 '07 #3
markrawlingson
346 Expert 100+
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
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...
5
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...
3
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...
24
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...
3
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...
6
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 .....
1
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...
3
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...
3
by: bhupesh8525 | last post by:
please help me thank to you in advance
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.