473,395 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
4 3993
>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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bacci | last post by:
I have two tables. The first is "Locations" which has 52,000 zip codes w/cooresponding latitudes and longitudes. The second "Suppliers" has 2,000 company names and addresses. The user enters a...
13
by: dogu | last post by:
Noob alert. Code is below. File is saved as a .php. What I'm trying to do: User uses 'select' box drop down list to pick a value. Value ($site) is derived from a db query. This works fine....
5
by: Morris | last post by:
This may not be possible on the server side, so apologies if this is the wrong group for this post. My form consists of an unknown number of pairs of text boxes. They are named textbox_a and...
4
by: Orion | last post by:
Hi, This is kind of last minute, I have a day and a half left to figure this out. I'm working on a project using ms-sqlserver. We are creating a ticket sales system, as part of the system, I...
4
by: suffrinmick | last post by:
Hi everyone! I (Along with the help of some of you guys!) have managed to get a query working which takes multiple values (types of organisation) from a list box. The query returns a list of...
19
by: Paul | last post by:
hi, there, for example, char *mystr="##this is##a examp#le"; I want to replace all the "##" in mystr with "****". How can I do this? I checked all the string functions in C, but did not...
3
by: mg | last post by:
In the click event handler of an imagebutton (WebForm), my C# code gets the values in some textboxes and insert these values into database tables The page reloads itself after this event and the...
0
southoz
by: southoz | last post by:
Good ay all , I'm fairly new to access(a little over 5 weeks now). Since I'v started I have picked up a lot of useful information from forums such as this and in doing so will share that information...
9
by: Kelii | last post by:
I've been trying to get this piece to work for a few hours, but have given up. I hope someone out there can help, I think the issue is relatively straightforward, but being a novice, I'm stumped....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.