473,587 Members | 2,588 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 3528
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******** ********@TK2MSF TNGP12.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******** ********@TK2MSF TNGP12.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="Page1Fiel d1">
</form>

Page 1 on submit sends it's info to Page 2

Page 2 :

<form....>
<input type="hidden" name="Page1Fiel d1">
<input type="text" name="Page2Fiel d1">
</form>

Page 2 calls page 3

Page 3 :

response.write( request.form(Pa ge1Field1))
response.write( request.form(Pa ge2Field1))

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 adOpenForwardOn ly = 0
Const adLockReadOnly = 1
Const adCmdTableDirec t = &H0200
Const adUseClient = 3

If Len(Request("pa genum")) = 0 Then
lqrystatus = request.form("D ropDownStatus") 'incomplete
lqrygrp = request.form("D ropDownSort")
lstartdate = request.form("s tartdate")
lenddate = request.form("e nddate")
lplocation = request.form("D ropDownLocation ")
lqryemp = request.form("D ropDownGroup")
'response.write (startdate & ", " & enddate & "," & qrygrp)
Else
lqrystatus = request.form("q rystatus") 'incomplete
lqrygrp = request.form("q rygrp")
lstartdate = request.form("s tartdate")
lenddate = request.form("e nddate")
lplocation = request.form("p location")
lqryemp = request.form("q ryemp")
'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("pa genum") & chr(13))
response.write ("hello " & lqryemp & chr(13))

sql and query building in here.....

Response.Write "<a href=""" & Request.ServerV ariables("SCRIP T_NAME") &
"?pagenum=1"">F irst Page</a>"

Response.Write "&nbsp;|&nb sp;"

If abspage = 1 Then
Response.Write "<span style=""color:s ilver;"">Previo us Page</span>"
Else
Response.Write "<a href=""" & Request.ServerV ariables("SCRIP T_NAME") &
"?pagenum=" & abspage - 1 & """>Previou s Page</a>"
End If

Response.Write "&nbsp;|&nb sp;"

If abspage < pagecnt Then
Response.Write "<a href=""" & Request.ServerV ariables("SCRIP T_NAME") &
"?pagenum=" & abspage + 1 & """>Next Page</a>"
Else
Response.Write "<span style=""color:s ilver;"">Next Page</span>"
End If
Response.Write "&nbsp;|&nb sp;"

if abspage = pagecnt then
Response.Write "<span style=""color:s ilver;"">Next Page</span>"
Else
Response.Write "<a href=""" & Request.ServerV ariables("SCRIP T_NAME") &
"?pagenum=" & pagecnt & """>Last Page</a>"
end if
Response.Write "</div>" & vbcrlf
thanks,
Will

"Simon Wigzell" <si**********@s haw.ca> wrote in message
news:gu_ob.2541 59$9l5.111344@p d7tw2no...

"wk6pack" <wk***@sd61.bc. ca> wrote in message
news:%2******** ********@TK2MSF TNGP12.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="Page1Fiel d1">
</form>

Page 1 on submit sends it's info to Page 2

Page 2 :

<form....>
<input type="hidden" name="Page1Fiel d1">
<input type="text" name="Page2Fiel d1">
</form>

Page 2 calls page 3

Page 3 :

response.write( request.form(Pa ge1Field1))
response.write( request.form(Pa ge2Field1))

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
2137
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 the second page will always all records number minus pagesize. for example, if I have total 5 records and pagesize = 2, then first page will show 5...
3
1609
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 nicely, including the paging. I have now changed the query to select from two joined tables and suddenly it tells me that my recordset does not support...
2
1748
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 data. So far so good for a tiny amount of data but if some 100000 of rows are the source this approach is stupid.
2
3145
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 sorting as well as paging of the datagrid records.
2
6443
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 begin and occured .I want to separate this code and compiling .vb code using VBC.exe later .(bin/paging.dll) when do it like me so you retrive only <...
2
13168
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 fields to be included in the table, which is to be bound to the gridview. The web form looks like so (Don't worry about the stupidity of this web...
2
1921
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 particular order (like ProductID, Name, Description, Quantity etc.) are displayed in one DataGrid where as the personal details of the buyer...
7
2319
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, etc.) suggest using an ObjectDataSource which has built-in paging functionality that, when used in conjunction with certain SQL 2005 functionality,...
1
2607
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 click the paging link (2,3,4.. ) it produces the result properly, But my problem is when i tried to press the Refresh button in the explorer, it throws...
2
5501
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 results page. - Recordset Paging works if no parameters are used in the recordset sql code (ie. simple sql code): SELECT * FROM db_name WHERE...
0
7843
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7967
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8220
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6621
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5713
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1452
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1185
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.