473,511 Members | 15,624 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 19 '05 #1
3 3524
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" <wk***@sd61.bc.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

Jul 19 '05 #2

"wk6pack" <wk***@sd61.bc.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

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.
Jul 19 '05 #3
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" <si**********@shaw.ca> wrote in message
news:gu_ob.254159$9l5.111344@pd7tw2no...

"wk6pack" <wk***@sd61.bc.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
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

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.

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2124
by: Li | last post by:
Hi, guys, I got a problem when trying to paging the recordset. the problem is even I set the pagesize but the first page will always show all the records and the number of records that shown on...
3
1605
by: sara | last post by:
Hi all, I have a strange problem. I have a page where I am creating a recordset that can handle paging and the query for it was originally selecting from only one table. This was all working...
2
1740
by: Daniel Walzenbach | last post by:
Hi, I have a question regarding the DataGrid control. If paging is enabled the grid binds the data, sets the paging on the top/bottom (or however it is set up) and throws away unnecessary...
2
3141
by: saleek | last post by:
Hi, I am trying to figure out why my datagrid has stopped firing the page and sort commands. Scenario: I originally had template columns in my datagrid and had set up custom bi-directional...
2
6433
by: farhad13841384 | last post by:
Hi , I Hope You fine. I have some problem with this code for paging in asp.net this bottom code work correctly without any error but when I try to place separate code in .VB file then error is...
2
13161
by: antonyliu2002 | last post by:
I've been googling for some time, and could not find the solution to this problem. I am testing the paging feature of gridview. I have a very simple web form on which the user can select a few...
2
1915
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a...
7
2316
by: =?Utf-8?B?SmVmZiBCZWVt?= | last post by:
The default paging behavior of the gridview doesn't work well with very large sets of data which means we have to implement some sort of custom paging. The examples I have seen (4guysfromrolla,...
1
2603
by: =?Utf-8?B?TG95b2xhIHN0YWxpbg==?= | last post by:
Hi, I am using ASP.Net 2.0 version and Windows'XP OS. I am useing the Grid view control to display the user details along with the paging concept provided by the grid view control. When i...
2
5496
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5077
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.