By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,665 Members | 1,912 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,665 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Apr 7 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
>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
Apr 7 '06 #2

P: n/a
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
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"keithb" wrote:
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

Apr 7 '06 #3

P: n/a
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
"darrel" <no*****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
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

Apr 7 '06 #4

P: n/a
Keith look at Terri's article here at
http://aspalliance.com/687
You would enjoy it
Patrick

"keithb" <kb******@dslextreme.com> wrote in message
news:Oa**************@TK2MSFTNGP04.phx.gbl...
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
"darrel" <no*****@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>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


Apr 8 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.