开发者

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

开发者 https://www.devze.com 2022-12-31 23:24 出处:网络
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 t

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消