65.9K
Home

Prevent firing button click event when refreshing the page

Prevent firing button click event when refreshing the page

During development we can come across this issue. I found many solutions about this issue. However i found an easy solution for this. I add the following line of code in my button click event and it resolves the problem.
Page.Response.Redirect(Page.Request.Url.AbsoluteUri);
It prevents firing the button click event when we refresh the page.