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.
精彩评论