
June 5th, 2003, 09:27 AM
|
|
Registered User
|
|
Join Date: Jun 2003
Posts: 4
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Every time that i press the refresh button....
Hi,<br>I am facing a very odd problem. <br>I am using a datagrid in order to update a database. <br>In the database i have one table with an autoincrement field. <br>When i insert a record to the database, the record is inserted ok <br>but if i press the refresh button of my browser the record is being inserted again. <br>Some how the last event fires again each time i press the refresh button.<br>I am using the viewstate command to preserve values between postbacks. <br><br>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. <br><br>How can i avoid firing the same event each time the user presses the refresh button?<br>Note: I am using the code from ASP.NET Matrix example (Updateable datagrid)<br><br>Please help me.<br>Thanks in advance
|