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!

ado paging question

Status
Not open for further replies.

briancostea

Programmer
Apr 21, 2005
82
US
i have a web page where i return the results five pages at a time. everything seems to work fine except where i want to highlight the page the user is currently on. please see the following code (bold is the link that doesn't work):

''set intpage to page the user wants
Select Case Request("action")
case 0
intpage = Request("intpage") + 1
if intpage > pageCount then intpage = pageCount
if intpage < 1 then intpage = 1
case else
response.write "<br>correct spot::" & request("action") & "<br>"
intpage = request("action")
End Select

''display the results
If Not rsShw.EOF Then
%><form name=frmShw method=post action="dspmsg.asp">
<input type=hidden name=hid_Shw>
<%
rsShw.AbsolutePage = intpage
For intRecord = 1 To rsShw.PageSize
area = rsShw("area")
recNum = rsShw("record")
topic = rsShw("topic")
%><center><table width=420>
<tr><td width=100 align=left class=first><%=rsShw("mod")%></td><td width=220 class=first align=right><%=rsShw("crtDate")%></td><td width=100 class=first align=right><%=rsShw("replies")%> replies</td></tr>
<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;<a href="prepare.asp?area=<%=area%>&record=<%=recNum%>" class=dspLink><%=topic%></a></td></tr>
</table></center><%
rsShw.MoveNext
If rsShw.EOF Then Exit For
Next

''show the rest of the pages user can see
<input type="hidden" name="intpage" value="<%=intpage%>">
<input type=hidden name=area value="<%=area%>">
<input type="hidden" name="action">
<center><table width=420><tr><td align=center><%

For intRecord = 1 To rsShw.PageCount
******* this is always false if i click a page # link
******* it works if if i click the Next link
if intpage = intRecord then
lnkClass = "dspLinkA"
else
lnkClass = "dspLink"
response.write "<br>in else for rec " & intRecord & ": intpage = " & intpage & "<br>"
end if
%>
****** here is the link that doesn't work ******
<a href="javascript:verify(this,<%=intRecord%>)" class="<%=lnkCLass%>"><%=intRecord%></a>
<%
Next%>
<a href="javascript:verify(this,0)" class=dspLink>Next</a></td>
</tr></table></center>
</form>

''javascript functions
function verify(obj,rec)
{
var recInt;
recInt = parseInt(rec);
document.frmShw.action.value = recInt;
document.frmShw.submit();
}

i'm not sure if it is something in the javascript function, or the way that "action" is set. thanks for any help.
 
If you use the "View Source" feature on your browser, does it look the way you expect?
 
no. why would i be posting if it did?

lnkClass is always set to "dspLink".

i put code to output what is in intRecord and intpage, and it looks like they are set correctly. the records from the ado recordset are displayed correctly, also.
 
try using cInt(intPage) and cInt(intRecord) and see if that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top