Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 09:22 AM
wk6pack
Guest
 
Posts: n/a
Default asp paging problem

Hi,

I have an asp page that I would like to do paging. The problem I'm running
into is that the same page that prints to the output is also recieving data
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 advance to
the next page?

thanks,
Will


  #2  
Old July 19th, 2005, 09:22 AM
Ray at
Guest
 
Posts: n/a
Default Re: asp paging problem

Well, I guess that all depends on how your page is coded. Here are some
paging examples.

http://www.asp101.com/articles/recor...ging/index.asp
http://www.intranetjournal.com/ix/msg/39939.html
http://www.codeproject.com/asp/rspaging.asp
http://www.aspfree.com/examples/1808,1/examples.aspx
http://www.aspfaq.com/2120

Ray at work

"wk6pack" <wkwan@sd61.bc.ca> wrote in message
news:%23eDKnLAoDHA.1488@TK2MSFTNGP12.phx.gbl...[color=blue]
> Hi,
>
> I have an asp page that I would like to do paging. The problem I'm[/color]
running[color=blue]
> into is that the same page that prints to the output is also recieving[/color]
data[color=blue]
> 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 advance[/color]
to[color=blue]
> the next page?
>
> thanks,
> Will
>
>[/color]


  #3  
Old July 19th, 2005, 09:22 AM
Simon Wigzell
Guest
 
Posts: n/a
Default Re: asp paging problem


"wk6pack" <wkwan@sd61.bc.ca> wrote in message
news:%23eDKnLAoDHA.1488@TK2MSFTNGP12.phx.gbl...[color=blue]
> Hi,
>
> I have an asp page that I would like to do paging. The problem I'm[/color]
running[color=blue]
> into is that the same page that prints to the output is also recieving[/color]
data[color=blue]
> 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 advance[/color]
to[color=blue]
> 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 but
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.


  #4  
Old July 19th, 2005, 09:24 AM
wk6pack
Guest
 
Posts: n/a
Default 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 "&nbsp;|&nbsp;"

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 "&nbsp;|&nbsp;"

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 "&nbsp;|&nbsp;"

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]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles