Button click fires when I refresh page

Posted by SurajRane under ASP.NET on 6/9/2010 | Views : 5098 | Status : [Member] | Replies : 1
I have a button on form.I have implemented button_click event for the button as follows

protected void button_Click(object sender,EventArgs e)
//i did following operation

// update salarytbl set salary=salary+1000

Here if i click button it will fire click event and update salary say salary is 500 then updated will be 1500

but now when i click refresh button again salary is updated to 2500, again i click refresh salary is 3500.. it goes

ie button click is fired when i say refresh.

why it is happening??


Posted by: Vuyiswamb on: 6/9/2010 [Member] [MVP] [Administrator] NotApplicable

in your page load event add the following code



//Do all the operation that was done on page load

Thank you for posting at Dotnetfunda

SurajRane, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response