472,119 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 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 1753
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

Post your reply

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

Similar topics

5 posts views Thread by Bob Bedford | last post: by
3 posts views Thread by Marcel | last post: by
24 posts views Thread by Ian Rastall | last post: by
6 posts views Thread by gwenna | last post: by
reply views Thread by leo001 | last post: by

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.