Current location: Hot Scripts Forums » Programming Languages » ASP » How to limit items posted per page (on web site)


How to limit items posted per page (on web site)

Reply
  #1 (permalink)  
Old 01-01-06, 09:46 PM
Stulie Stulie is offline
New Member
 
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
How to limit items posted per page (on web site)

Hi I am going to do my best to explain the problem. I am fairly new to using ASP and I am pretty well teaching myself so bare with me.

Issue: I have created a website for a car lot. All of the information for the vehicles are submitted using a form and added to a database created with Access. Currently when you go to thier website and check thier inventory, the database gets queried, an image and some basic information loads to a simple table. As the query finds another car it loops and loads a new table on the page. Everything here is working as it should but now that thier inventory is growing, you have to scroll further than the client would like to see. The client now would like the page to show only a certain number of vehicles per page then you would have to click 'Next' or a page number to view the next page of vehicles. How can you go about only querying a certain number of items then creating a new page. It would have to auto create the page number on the web site and when going between pages not seeing the same vehicle twice.

I hope my question is understood and I thank anyone in advance who is able to assist.

Thanks, Steve V.
Reply With Quote
  #2 (permalink)  
Old 01-02-06, 06:53 AM
koncept
Guest
 
Posts: n/a
several things

1. if you can do not use access....it can prove to be problematic down the road.
2. use select *,(select count(*) from same_table where this = that) as record_count from table where this = that limit (start, end)
3. then based on the record count create next and previous buttons, and fill in the limit portion of sql
Reply With Quote
  #3 (permalink)  
Old 01-02-06, 05:05 PM
Stulie Stulie is offline
New Member
 
Join Date: Jan 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Tnx Koncept....unfortunately I don't understand enough about ASP to get what you are saying....lol.

I found this today.

http://www.codefixer.com/codesnippet...dsetpaging.asp

This code, although quite lengthy actually works very well. I posts everything from the database and leaves the connection open to post the next results without repeating any more than once. It also automatically shows the page numbers at the bottom the way I wanted. Only 1 thing I need it to do but I am not shure how to. That current code only will only list vertically. What I need it to do is list the results horizontal for 3 listings then drop to the next line for 3 more. What I need is 3 rows of 3, then have it make a new page.

Tnx in advance,
Steve
Reply With Quote
  #4 (permalink)  
Old 01-02-06, 05:11 PM
koncept
Guest
 
Posts: n/a
to build a 3 by 3 grid is easy enough to do...

Code:
 	  <td><div align="center"><a href="ipics.asp?fold=<%=request.QueryString("fold")%>&pic=<%=file.name%>"><img src="<%=request.QueryString("fold") & "/" & file.name%>" width="130"  height="130" border="0"></a></div></td>
 <%
 	  intpiccounter = intpiccounter + 1
 	  if intpiccounter = intpicsperrow then
 %>
   </tr><tr>
 <%
 		intpiccounter = 0
 	  end if
edit: you will need to have a table around parts of this

it will replace these lines from the example
Code:
                  response.write "ID: " & Recordset ("ID") & "<br>"
  response.write "Sitename: " & Recordset ("Sitename") & "<br>"
  response.write "URL: " & Recordset ("URL") & "<br><br>"
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get Indexed in Google Quickly rorycanyon General Advertisements 3 03-21-07 09:11 AM
Outsourcing web design to Bulgaria - Marin Todorov gal_flower Job Offers & Assistance 4 02-14-06 08:05 PM
Contest - Design The World's Worst Web Page snaip Announcements 1 02-08-05 09:09 AM


All times are GMT -5. The time now is 03:37 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.