About Refresh Button

W

wright

Hi,
I am facing a very odd problem.
I am using a datagrid in order to update a database.
In the database i have one table with an autoincrement field.
When i insert a record to the database, the record is inserted ok
but if i press the refresh button of my browser the record is being inserted
again.
Some how the last event fires again each time i press the refresh button.
I am using the viewstate command to preserve values between postbacks.

When i insert a new record the AddNewRecord property is set to true and when
i refresh the page this property is still set to true the insert event is
fired and the same record is being inserted.

How can i avoid firing the same event each time the user presses the refresh
button?
Note: I am using the code from ASP.NET Matrix example (Updateable datagrid)

Please help me.
Thanks in advance
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top