Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

page_load event question 1

Status
Not open for further replies.

drew10

Programmer
Feb 26, 2002
123
US
I have an app that calls a stored procedure to get a uniqueID for transactions. After the form is submitted and the data is inserted into the db, if a user clicks back to the transaction page, the original uniqueID is still present, so any additional transactions fail because it creates a duplicate of the primary key in the db. I call the stored procedure in the page_load event. When does the page_load event get called? Should I be calling my sproc earlier in the page_init? Any input would be greatly appreciated!
-drew10
 
the PageLoad is called everytime the page is loaded, even from a postback.

hth Daren J. Lahey
Just another computer guy...
If you are unsure of forum etiquette check here FAQ796-2540
 
Is a page1 loaded again in this situation:

Page1 is a form that submits data to a db and then redirects to the homepage.

The user clicks the back button on the browser to take them back to Page1.

Is the page_load event going to be called for Page1?
 
no, because all they are doing is navigating back to the last page they were at, which is stored in the client's temp internet files folder.

What you need to do is disable the back button, or else set the page to not be cached on the users machine. I attempted to do the cache thing, but it got messy. I'm going to try and use Paul's (link9) suggestion instead, which you can read at post:

thread855-358826

D'Arcy
 
Thanks D'Arcy! I went back and reviewed the thread and dropped link9 a star for his explantion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top