Prevent page refresh on pressing F5

karthik k picture karthik k · Nov 19, 2010 · Viewed 8.4k times · Source

I have Created form with Server Side control like button..and also have written event on that.. Now runtime after click on the button i have refreshed the page by pressing F5.Page_load is executing fine but button1_click() event also firing...So how can i stop this event execution in this scenario.Please suggest me

Answer

Joel Martinez picture Joel Martinez · Nov 19, 2010

Short Answer: Not possible

Longer Answer: No web site can block the browser's functionality as that would be a serious security concern for the browser.