•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 427,237 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,219 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1865 | Replies: 4
![]() |
•
•
Join Date: Aug 2006
Posts: 23
Reputation:
Rep Power: 3
Solved Threads: 0
hi everybody. i got a list of checkboxes and radio button with the recorset paging function. let said i got the paging list << 1 2 3 4 5 >>. i set each page is 10 records. and every record got one checkbox for DELETE ID usage. in the first page, i check 5records, then i go to second page, i checked another 5records. but why it cant keep the value for the first page 5records when i go back or go to next pages? hope u all can give me some solution on it.plz help..thank you.
•
•
Join Date: Sep 2007
Posts: 1,057
Reputation:
Rep Power: 4
Solved Threads: 61
you probably set the checkboxes to new values. ASP does not store values for you and everytime you get "new page", they are reset. You have a choice here.. you can, on each page load, store the values in a hidden input value. Then, with asp, search the checkboxes on the page that have that value and check them if they do. If not, they won't be checked. THen under a user submit to delete, grab the value of the hidden variable and put it into an array. Then add the additional checkboxes that are checked on the page to that array, then do a loop to delete.
vuala
vuala
•
•
Join Date: Jun 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
•
•
•
•
you probably set the checkboxes to new values. ASP does not store values for you and everytime you get "new page", they are reset. You have a choice here.. you can, on each page load, store the values in a hidden input value. Then, with asp, search the checkboxes on the page that have that value and check them if they do. If not, they won't be checked. THen under a user submit to delete, grab the value of the hidden variable and put it into an array. Then add the additional checkboxes that are checked on the page to that array, then do a loop to delete.
vuala
hi there vuala
coould you please give a code example
thanks a lot
•
•
Join Date: Sep 2007
Posts: 1,057
Reputation:
Rep Power: 4
Solved Threads: 61
•
•
•
•
hi there vuala
coould you please give a code example
thanks a lot
Actually, no lol. If you post your code, I can give you an update code snippet to show you what you need to do.
For this, and most cross-page checks, you have many options, but all options you will need to store the data somewhere.
Options:
1. Use javascript and stay on the same page without going to another page at all. Using javascript (another programming language), you can load all records onto the current page and hide and show certain layers on the page. Thus, every layer is still part of the page, you can keep the elements checked.
2. Create an array after they click to the next page (most efficient and favorable). When they click to goto the next page, loop through all the checkboxes and for those who are checked, add their id's onto the array. Then, store the array in a session variable. (This can be avoided by using server.transfer method, but more coding than is required). On the following page, let them check more boxes. After they click back or next, add those checkbox id's onto the array, and restore it in the session variable. When they finally click delete, just loop through the ID's and delete. But remember, on each page, you will need to check for that session variable, loop through the id's, and check the ones that were checked previously. This isn't a big task, it's actually quite small (depending on how you layer things). Attempt it, and let me know the code to help you.
3. Store the id's in a file. This is very inefficient as if you have 1000 people viewing your site at one time and searching, you will have 1000 files, not to mention the IO (file methods) methods are very costly on your environment.
4. Delete after every page. If they wish to go to the next page, let them know that by leaving the page, they will delete teh selected users (not a user friendly program at all).
5. Don't show them pages, show it all on one page.
Let me know if you have any questions.
Last edited by SheSaidImaPregy : Jun 7th, 2008 at 9:02 pm.
I answer pm's.
I answer questions.
I answer quickly.
I answer.
I answer questions.
I answer quickly.
I answer.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: How to Create a search engin to search my site
- Next Thread: Really Stuck - ASP/Javascript Form Validation



Linear Mode