Posted on: 2/11/2014 11:12:58 AM | Views : 618

I have a FormView on a page (actually in an Iframe in a modal popup although this is not relevant to the current issue) which just adds a record to a database. Consequently the DefaultMode is set to Insert and the InsertItemTemplate includes a button with ID="Insert" and CommandName="Insert". The insert operation is handled by a method in my data access layer via an ObjectDataSource. All perfectly standard and all working and an approach that I have been using for years.
What I would now like to do to make my web pages more robust is to hide the Insert button once it has been clicked (so that it cannot be clicked twice). I can do this in code behind on the FormView's Databound event by testing for IsPostback and setting visibility accordingly. But in a real world situation I might get multiple postbacks during the life of the page, so I really need to do this on on either the ODS Inserting or the ODS Inserted event. But this does not ...

Go to the complete details ...