|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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) |
|
#2
|
||||
|
||||
|
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. |
|
#3
|
|||
|
|||
|
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? |
|
#4
|
||||
|
||||
|
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?
|
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
Quote:
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > HELP!! Regenerating record set each time page loads!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|