This seems to be a very common problem where by your event handler method gets run twice.
It is caused by VS.NET inserting 2 wireup of the event handler:
- once in the aspx (HTML) eg: <asp:Button ... OnClick="btnTest_Click" />
- and once in the VS.NET generated section (InitializeComponent) eg:
this.btnTest.Click += new System.EventHandler(this.btnTest_Click);
The easiest solution, imo, is to simply remove the "OnClick..." HTML markup from the .aspx page.
Eg change this:
<asp:Button ID="btnTest" runat="server" Text="Test" OnClick="btnTest_Click" />
To this:
<asp:Button ID="btnTest" runat="server" Text="Test" />
Rebuild, and bingo! - 1 event per click.
HTH
Tim