Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

querystring question

Status
Not open for further replies.

techskool

Technical User
Jun 20, 2002
151
GB
Hi Guys

I have asp pages which i page through with a next and previous link.
eg:
PREV : NEXT

I recently added code to allow me to see page numbers as well:
eg:
PREV 34567 NEXT


My code is

<%
For I = 1 To TotPage
If I = CPage Then
response.write I
Else%>
<a href=&quot;search.asp?CurrentPage=<%=I%>&quot;><%=I%></a>
<%
End If
Next 'I
%>

all i am passing over the querystring is the current page number. To add the possible values that could be passed to the querystring on this link would be messy.

I basically want to pass the querystring on the present page (being viewed) to the querystring on this link in the loop.

However using the server.urlencode method i end up with 2 currentPage values, and so the page wont be called.

Can i just pass the existing querystring onto this new one, while dropping one of the querystring values?

Thax

Dave

:)
 
yeah same here...

Known is handfull, Unknown is worldfull
 
This always happens, im rubbish at describing problems

Right

i need

<a href=&quot;search.asp?CurrentPage=<%=I%>&ALL THE REST OF THE PREVIOUS QUERYSTRING, MINUS THE CURRENT PAGE PART OF THE PREVIOUS QUERYSTRING&quot;><%=I%></a>

Hopefully a bit clearer

Thanx

Dave
 
solved the original problem
#
Im using this:

<a href=&quot;search.asp?CurrentPage=<%=I%>&id=<%=searchTerm%>&idf=<%=f%>&alp=<%=s%>&Artist=<%=Artist%>&Title=<%=Title%>&Label=<%=Label%>&YearMade=<%=YearMade%>&InStock=<%=InStock%>&Audio=<%=Audio%>&Picture=<%=Picture%>&CloseUp=<%=CloseUp%>&quot;><%=I%></a>

I use 3 variations of the search words on the string here an alphabetical, a quicksearch and a refined search, feeding an 3 possible sql statements.

This all works fine, however i just thought the querystring looked a bit naff when you see it on the page, having so many null values on the values i dont use.

this was why i originally wanted to just use values from the original search, but when i started paging it forgot them, so i wanted to remember the original querystring, minus the currentpage (otherwise it wouldnt page)

Any way it messy, but it works :)



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top