ASP.NET Detect Browser Refresh

  • Thread starter Thread starter Alphonse Giambrone
  • Start date Start date
A

Alphonse Giambrone

I am relatively new to ASP.NET and just got my bound datagrid utilizing a
typed dataset to work the way I want to add, delete and update data.
The problem I am running into now is when clicking refresh on the browser
after adding a new record. Since the browser sends the same information back
to the server, the same data row is attempted to be inserted again.
Obviously this is not desirable.
I see no simple way to determine if the request is a refresh (so my code can
ignore the insert) or a new request.
This must be a common problem, yet I find very little information on it
anywhere.
Am I missing something? How is this typically handled?
 
This isn't really an ASP.NET question specifically as the same thing applied
in ASP.
One way, not the best is to set a session variable when the form is posted.
Only insert if the session variable hasn't already been set. Make sense?
-Francis Shanahan
http://www.FrancisShanahan.com
 
Thanks, that works. I guess I was just so surprised that in all the
walk-throughs and samples for the data grid, this was never mentioned.
 
Back
Top