简体   繁体   中英

user control Button click event called again when page is refreshed using F5

I found that if you press F5 or refress from browser window, the last event fires again example, I have clicked on a button, the button event is carried out normally, but if I refresh the page by pressing F5 key the same event is fired again.

anyone have any Idea to solve this?

What happens there is that the refresh triggers the post back not just the page load -- so the event is triggered. A simple solution would be to redirect the user to a fresh new page after handling the event.

This way if the page is reloaded it's a new page, not the post back.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM