Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > About Refresh Button

Thread Tools

About Refresh Button

Posts: n/a
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
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
Note: I am using the code from ASP.NET Matrix example (Updateable datagrid)

Please help me.
Thanks in advance

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP: Session parameters vanish on refresh. How do I keep them on refresh? Per Magnus L?vold Java 1 10-08-2004 02:52 PM
How do i refresh a datagrid from a pop up window without having to refresh the whole page? Pkenty ASP .Net Web Controls 0 05-28-2004 07:06 AM
using refresh button on the menu bar to refresh two frames. Jawahar Rajan ASP General 1 10-01-2003 09:20 PM
Problem with refresh button breaking automatic refresh brian lanning ASP .Net 0 07-29-2003 07:57 PM
How can I prevent a button event firing on page refresh? Stan ASP .Net 1 06-30-2003 03:27 PM