Closed Thread Icon

Topic awaiting preservation: Page Index Problem (ASP) (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12966" title="Pages that link to Topic awaiting preservation: Page Index Problem (ASP) (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Page Index Problem (ASP) <span class="small">(Page 1 of 1)</span>\

 
Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 11-04-2003 03:56

Hi, guys. how are you?
Well, I have got a problem to make page index things.
I wanna to show 10 items each page.
I succeed doing it but I cannot have page index.
Like if there are 5 pages, I wanna show 1, 2, 3 , 4, 5 at the bottom of the page.
What I did is here:

code:
<%
Response.write("<br>")
For i=1 to maxpages
Response.write("<a href=page.asp?pg=<%=i %>" & i & "</a> ")
Next
%>



I can generate page number accroding to the database.
But each link doesn't work.
I am not sure about querystring part.

[code] <a href=page.asp?pg=<%=i%>" &i&"</a>")[code]

This line making link. But ?pg=<%=i%> doesn't make number.
Do you know what I mean?
Pleaes help!

Hiroki Kozai

jdauie
Bipolar (III) Inmate

From: Missoula, MT
Insane since: Jan 2003

posted posted 11-04-2003 04:14

<%=i%> is shorthand for Response.Write(i). When you try to do that inside a string it is being evaluated as a string.

Here:

code:
<%
Response.write("<br>")
For i=1 to maxpages
Response.write("<a href=""page.asp?pg=" & i & """>" & i & "</a> ")
Next
%>

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 11-04-2003 04:38

Thank you very much.
It works great!
Have a good day.
Cheers.



Hiroki Kozai

« BackwardsOnwards »

Show Forum Drop Down Menu