views:

235

answers:

0

hi expert i am new in asp.net development, i have problem when page load fired a click event of button is automatically fired will you please tell me why it is happening and what is the solutions for that.

lets

protected void butSubmit_Click(object sender, EventArgs e) { if(butSubmit.Text.ToString().Equals("Submit")) { InsertGroup(); ddlPageSize.Items.Clear(); FillddlPageSize(); } else { if (butSubmit.Text.ToString().Equals("Update")) { UpdateGroupDetail(); ddlPageSize.Items.Clear(); FillddlPageSize(); } } }

i had written a code on click of the submit button ,but when we refresh the page or reload a page the click event of the submit button is automatically fired.

so please tell me why it is happening and what is the solution. Thanks