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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Paging

Status
Not open for further replies.

RushiShroff

Programmer
Jan 23, 2002
216
IN
When I page records in ASP,below all links are coming
as 1 2 3 ..

Now I want to disable the current page link.Say page 1 is default so I dont want a link over that.Sameway if I select link 2,there shouldn't be a link.

This code is not working fine.

<%
for i=1 to rstSearchResults.PageCount
if i=currentPage then
%>
<%=i%>
<%else%>
<a href=&quot;Search_Results.asp?currentPage=<%=i%>&S_Category=<%=mCategory%>&T_searchfor=<%=StrForPag%>&quot;><%=i%></a>
<%end if%>
<%
next
%>
 
The problem seems to be in the comparision ... I think current page is converted to string as u might be taking it from querystring. try out:

&quot;if i=cint(currentPage) then&quot;

instead of

&quot;if i=currentPage then&quot;

offcourse if currentpage=&quot;&quot; then make currentpage=1..

hope this helps,


srinu...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top