Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 3rd, 2003, 06:10 PM
Registered User
 
Join Date: Jun 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default MultiPage Menu

:(Okay I have a big question.

I'm creating a scheduling system, and the users want to be able to select all items on a list, and place the items on a certain form that only holds seven items. So if the user selects 14 items they would like it to create a header at the top and add page numbers according to the number of jobs(ie-14 Jobs = 2 Pages), if you click on the page number the user wants it to view the second set of items on the next page. Anything to point me in the right direction please HELP.
 
Old June 3rd, 2003, 10:00 PM
Authorized User
 
Join Date: Jun 2003
Posts: 46
Thanks: 0
Thanked 1 Time in 1 Post
Default

The easiest ways to accomplish this sort of thing are to use a dropdown or an HTML table (such as a datagrid) instead of links, but...

Also, I'm not sure how you do this in classic ASP, but in ASP.NET:

If you must use a link, one relatively easy way is to place a DIV or SPAN or similar element at the top of your form. Give it an ID and set runat=server. Use flow layout for the element.

In the code-behind, you will, of course, know how many items were selected and what page the user is on. This info will be either in session state or view state.

Based on the number of items selected, you compute the number of pages. In the code-behind, somewhere like page prerender, you add link controls to your DIV. Say its ID is "header", in VB.NET:

[This code is all sort of fuzzy, because I don't have access to Visual Studio right now, but you should be able to look it up and fix the problems.]

dim oA as control
for i=1 to nPages
   oA=new htmlsubmitbutton [or whatever the ASP.NET is, I forget]
   oA.text=i.tostring
   oA.ID="GoTo" & i.tostring [or whatever property it is, if not ID]
   Me.header.controls.add(oA)
next i
oA=nothing

This (or something similar) should give you a sequence of submit buttons. In the page load handler, you can check the Request.Item collection to see if one of the GoTo buttons was clicked, and you can then display the correct set of jobs/items.

There are probably dozens of other ways to do this, too, but that's what comes to mind.

-Van


Old dog learning new tricks...
 
Old June 5th, 2003, 11:17 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 215
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Basically you want to split the results over multiple pages and offer links to navigate from one page to the next. Correct?

I've written a fairly generalised Sub that generates page numbers based on a few inputs: total entries, current page, entries/page and querystring values. I could post it if it is needed.

regards
David Cameron





Similar Threads
Thread Thread Starter Forum Replies Last Post
multipage activate Fat_and_immoral Excel VBA 5 March 7th, 2007 02:03 PM
PHP Multipage to look like one Lofa PHP How-To 2 September 5th, 2006 12:52 PM
use of multipage MANOJMETAL VS.NET 2002/2003 0 April 17th, 2004 01:29 AM
TabsStrip and Multipage perignon Beginning VB 6 1 March 1st, 2004 04:14 AM
Multipage Menu LHaines Classic ASP Basics 1 June 3rd, 2003 07:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.