Tuesday, September 18, 2007

Detect Page Refresh : ASP.NET

In ASP.NET after page has done first postback, if the user makes a Refresh, the behavior is repeat the last postback. Let us imagine that we inserted data or we debit of a credit card, etc; one becomes a problem. Therefore one becomes important to handle this eventuality.

In Summary To handle a Session Flag and ViewState Flag, comparing them to know if one is about a Postback or a Refresh. For more details, see these articles.

http://www.codeproject.com/aspnet/Detecting_Refresh.asp
http://www.joel.net/code/refresh_capture.aspx
http://jarednevans.typepad.com/technoblog/2005/01/jareds_techno_b.html


Test it

No comments:

Google