Posted on: 4/15/2011 9:20:49 PM | Views : 427

I have a button that, with the clicking of the button, store procedure will be run and gift card will be added to the order. I have a problem, first when user clicks on the button it will be added and works fine but because I am not redirecting and staying in same page to get other information, if user click on the button again, it gave error “Violation of PRIMARY KEY constraint 'XPKtblOrderHold'. Cannot insert duplicate key in object 'dbo.tblOrderHold'”
Because It try to add again, how I can prevent this.
Also I try to have this block in  if (!IsPostBack) but it goes to the next page without adding gift card.
Ani Idea? appreciate your helpGo to the complete details ...