<p>I have created a user control to handle adding comments to certain business entities, like contacts and customers.  Works great ... except for one issue.</p>

<p>I am using a ListView control to edit and delete comments, and a separate area, on the same user control to add a new comment.  All of this is wrapped in an UpdatePanel.</p>

<p><img src="https://farm4.static.flickr.com/3239/2909377399_888d42b595.jpg?v=0" alt="Screenshot"></p>

<p>Here is my scenario ... the user adds a new comment ... the page does a postback, the data is successfully saved, and the ListView control is updated to show the new comment.  Now, if the user <strong>refreshes</strong> the browser, it will naturally postback again and will add another duplicate record. </p>

<p>Any ideas on how best to prevent this?</p>

I haven't used ASP.NET in a few years, but you should wrap your "do this on postback" code in
```
Page.IsPostBack
```
:
```
```
if(IsPostBack) {
    //do your data-saving code...
}
```
```
MSDN link