When you add a button control in your web part the event
handler attached to the button (i.e. button click event) fires even on page
refresh. At times developers need to differentiate between page refresh and
button click event
This
behavior is due to button control not having an associated ID and can be solved
be defining ID to the button control as shown below