About Refresh Button

Discussion in 'ASP .Net Web Controls' started by wright, Oct 21, 2003.

  1. wright

    wright Guest

    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
     
    wright, Oct 21, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Stan
    Replies:
    1
    Views:
    1,810
    Tomasz Kaszuba
    Jun 30, 2003
  2. brian lanning
    Replies:
    0
    Views:
    612
    brian lanning
    Jul 29, 2003
  3. Per Magnus L?vold
    Replies:
    1
    Views:
    5,170
    John C. Bollinger
    Oct 8, 2004
  4. Pkenty
    Replies:
    0
    Views:
    414
    Pkenty
    May 28, 2004
  5. Jawahar Rajan
    Replies:
    1
    Views:
    303
    Adrienne
    Oct 1, 2003
Loading...

Share This Page