Re: asp paging problem
Hi Simon,
It doesnt seem to be recognizing the hidden variables? When the form
resubmits itself, the hidden variables are blank.
Here's the code:
<form name="queryform" method='post'>
<%
' ADO constants used in this page
Const adOpenForwardOnly = 0
Const adLockReadOnly = 1
Const adCmdTableDirect = &H0200
Const adUseClient = 3
If Len(Request("pagenum")) = 0 Then
lqrystatus = request.form("DropDownStatus") 'incomplete
lqrygrp = request.form("DropDownSort")
lstartdate = request.form("startdate")
lenddate = request.form("enddate")
lplocation = request.form("DropDownLocation")
lqryemp = request.form("DropDownGroup")
'response.write(startdate & ", " & enddate & "," & qrygrp)
Else
lqrystatus = request.form("qrystatus") 'incomplete
lqrygrp = request.form("qrygrp")
lstartdate = request.form("startdate")
lenddate = request.form("enddate")
lplocation = request.form("plocation")
lqryemp = request.form("qryemp")
'response.write(startdate & ", " & enddate & "," & qrygrp)
end if
response.write ("<input type='hidden' name='qrystatus' value='" & lqrystatus
& "'>")
response.write ("<input type='hidden' name='qrygrp' value='" & lqrygrp &
"'>")
response.write ("<input type='hidden' name='startdate' value='" & lstartdate
& "'>")
response.write ("<input type='hidden' name='enddate' value='" & lenddate &
"'>")
response.write ("<input type='hidden' name='plocation' value='" & lplocation
& "'>")
response.write ("<input type='hidden' name='qryemp' value='" & lqryemp &
"'>")
response.write Len(Request("pagenum") & chr(13))
response.write ("hello " & lqryemp & chr(13))
sql and query building in here.....
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") &
"?pagenum=1"">First Page</a>"
Response.Write " | "
If abspage = 1 Then
Response.Write "<span style=""color:silver;"">Previous Page</span>"
Else
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") &
"?pagenum=" & abspage - 1 & """>Previous Page</a>"
End If
Response.Write " | "
If abspage < pagecnt Then
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") &
"?pagenum=" & abspage + 1 & """>Next Page</a>"
Else
Response.Write "<span style=""color:silver;"">Next Page</span>"
End If
Response.Write " | "
if abspage = pagecnt then
Response.Write "<span style=""color:silver;"">Next Page</span>"
Else
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") &
"?pagenum=" & pagecnt & """>Last Page</a>"
end if
Response.Write "</div>" & vbcrlf
thanks,
Will
"Simon Wigzell" <simonwigzell@shaw.ca> wrote in message
news:gu_ob.254159$9l5.111344@pd7tw2no...[color=blue]
>
> "wk6pack" <wkwan@sd61.bc.ca> wrote in message
> news:%23eDKnLAoDHA.1488@TK2MSFTNGP12.phx.gbl...[color=green]
> > Hi,
> >
> > I have an asp page that I would like to do paging. The problem I'm[/color]
> running[color=green]
> > into is that the same page that prints to the output is also recieving[/color]
> data[color=green]
> > from the previous page for query parameters for the sql string.
> >
> > When I click on the next page, it queries itself and loses all the query
> > parameter information from the parameter page and brings back all the
> > records.
> >
> > How can I keep the parameter values from the query form and still[/color][/color]
advance[color=blue]
> to[color=green]
> > the next page?
> >
> > thanks,
> > Will
> >
> >[/color]
> In the "next" page, include all the form fields sent to it in the new form
> using "hidden" as the field type. They won't show up on the "next" page[/color]
but[color=blue]
> will be added to it's form values. e.g.
>
> Page 1 :
>
> <form....>
> <input type="text" name="Page1Field1">
> </form>
>
> Page 1 on submit sends it's info to Page 2
>
> Page 2 :
>
> <form....>
> <input type="hidden" name="Page1Field1">
> <input type="text" name="Page2Field1">
> </form>
>
> Page 2 calls page 3
>
> Page 3 :
>
> response.write(request.form(Page1Field1))
> response.write(request.form(Page2Field1))
>
> Got it?
>
> Good luck. I spent ages and ages getting all this stuff down pat about
> passing form information around.
>
>[/color] |