ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old September 25th, 2003, 07:40 PM
masri masri is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 masri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Angry HELP!! Regenerating record set each time page loads!!

Ok, I've been at this for almost a week now, and its frustrating.

I have a form on a page (page1.asp) that submits data to an Oracle DB, and displays the data submitted on a second page (page2.asp). The database has a unique column (ID), therefore no duplicate IDs can be entered.

Ok, when I load page1.asp (where the form is) I generate a record set with all the IDs in the database, then upon submitting the form, I check the ID in the form, against those generated by the recordset...works perfectly.

Here's where I run into a problem; lets say for whatever reason the user decides to click 'Back' and submit the form again. Well, when he/she clicks back, the form page doesn't get reloaded, therefore the ID that they just entered isn't included in the recordset created, and so it won't catch it.

Is there ANY WAY to have the record set regenerated everytime the user comes to the page, even through the 'Back' button? Or does anyone have a better solution?? (other than using a no-cache statement)

Reply With Quote
  #2  
Old September 25th, 2003, 09:07 PM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
Well, since the back button doesn't reload the page, there isn't any way that I know of to refresh the recordset. Maybe you could use javascript to reload the page when the user clicks the back button? But I don't think there is an ASP solution. (If there is, I want to learn it ) The "better solution" is to use the no-cache statement. Why don't you want to use this method?
__________________
--Dave--

U2kgSG9jIExlZ2VyZSBTY2lzLCBOaW1pdW0gRXJ1ZGl0aW9uaXMgSGFiZXM=

Last edited by karsh44 : September 25th, 2003 at 09:09 PM.

Reply With Quote
  #3  
Old September 26th, 2003, 07:27 AM
masri masri is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 masri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Because even if I use the no-cache method, and the user enters the same ID again, it still won't catch it.

Also, I tried generating the recordset on the other end of the form (in page2.asp), but I can't find a way to go back to page1.asp without losing the form data.

For example:

- User fills out form on page1.asp and submits form

- page2.asp checks ID against recordset

- page2.asp finds the ID in the recordset

- ????? Then what? All I can do here is generate an error message, but is there a way to go back to the original form, with the original data? (an ASP version of Javascript's history.back(-1))

Any ideas?

Reply With Quote
  #4  
Old September 26th, 2003, 09:21 AM
karsh44's Avatar
karsh44 karsh44 is offline
Just another guy
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Jun 2003
Location: Wisconsin
Posts: 2,915 karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level)karsh44 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 13 h 6 m 22 sec
Reputation Power: 76
Why wouldn't the ID get caught if you use no-cache? By preventing the page from caching, every time the user goes there, the page reloads. This should regenerate the recordset. So if someone submits their id "1234", then when the hit back, the recordset refreshes, and should have "1234" in it, just as if they had come to the form for the first time. Am I missing something?

Reply With Quote
  #5  
Old September 26th, 2003, 08:03 PM
masri masri is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 masri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
No, you're right, I take that back. It will catch it when the user resubmits '1234' if the page is not cached. The problem is its a big form, so I wanted to make it more user-friendly by leaving the form filled out and alerting them that only the ID needs changing.

But I take it there is no way to do that through ASP.

Reply With Quote
  #6  
Old September 26th, 2003, 09:31 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,717 Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level)Doug G User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 40 m 34 sec
Reputation Power: 688
Quote:
But I take it there is no way to do that through ASP.
Is there a way to implement catching the new identity value if the user hits the back button in php or some other web app? If so, maybe the same mechanism will work similarly in asp.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > HELP!! Regenerating record set each time page loads!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway