Hi everyone.
I have a question about looping which I have been trying tp figure out for the last day or so and I want to see if any of you guys may have an idea.
What I am working on is a paged record set (like a search results page) that prints out links to each subsequent page like so:
I would like to add a variable into the query strings of the links shown above which would increment by a set number for each page.
For example:
Link to Page 2: value = 4
Link to Page 3: value = 8
Link to Page 4: value = 12
and so on...
Basically it will increment the value by four for each page (intPageCount).
I'd like the links to then look like this when printed:
If anyone has any ideas, I'd love to hear them. Thanks.
I have a question about looping which I have been trying tp figure out for the last day or so and I want to see if any of you guys may have an idea.
What I am working on is a paged record set (like a search results page) that prints out links to each subsequent page like so:
Code:
<%
for i = 1 to intPageCount
if i = intPageCurrent then
Response.Write(i)
else
%>
<a href="category.asp?catId=<%= catId %>&page=<%= i %>"><%= i %></a>
<%
end if
next 'I
if intPageCurrent < intPageCount then
%>
<a href="category.asp?catId=<%= catId %&page=<%= intPageCurrent + 1 %>">[>>]</a>
<%
end if
%>
I would like to add a variable into the query strings of the links shown above which would increment by a set number for each page.
For example:
Link to Page 2: value = 4
Link to Page 3: value = 8
Link to Page 4: value = 12
and so on...
Basically it will increment the value by four for each page (intPageCount).
I'd like the links to then look like this when printed:
Code:
<a href="category.asp?catId=1&page=1&value=0">1</a>
<a href="category.asp?catId=1&page=2&value=4">2</a>
<a href="category.asp?catId=1&page=3&value=8">3</a>
<a href="category.asp?catId=1&page=4&value=12">4</a>
If anyone has any ideas, I'd love to hear them. Thanks.