How to prevent query string values from being used more than once?

K

keithb

A page uses query string values to add a record to a database. The record
should be added only once; however, if a user activates the url additional
times, multiple records are added. Is there some way to remove the
parameters from the query sting to prevent undesired activations?

Thanks,

Keith
 
D

darrel

A page uses query string values to add a record to a database. The record
should be added only once; however, if a user activates the url additional
times, multiple records are added. Is there some way to remove the
parameters from the query sting to prevent undesired activations?

The submission of data shouldn't be triggered by a Page Load event. Also,
after submitting the data, you should refresh/redirect the page to avoid it
resubmitting.

Other than that, just check for duplicate entries before inserting the data.

-Darrel
 
G

Guest

Besides the good advise that Darrel provided, you could set a Session
variable to true right after the insert is completed. The in your Page_Load
handler, first check to see if this session variable exists and if it =true.
If not, do

Response.End();

Peter
 
K

keithb

I'm kind of new at this. If submission of data should not be triggered by a
page load event, how should it be triggered?

Thanks,

Keith
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top