简体   繁体   中英

Prevent button_click event in page refresh in c#

I want to prevent button_click event in page refresh. I have searched but can not get any solution relevant for me. I have found this one:
http://www.dotnetspider.com/resources/42823-How-Avoid-Re-Submitting-Data-Page-Refresh.aspx

But i do not need to go inside button_click event in page refresh.

Response.Redict("") also not relevant here as i am returning label text after succesful button_click.

What you looking for is not so simple.

The solution you can use for sure is the Post/Redirect/Get design pattern

or use some code that tries to detect the refresh of the page on:

http://www.codeproject.com/KB/aspnet/DetectingRefresh_.aspx

http://dotnetslackers.com/community/blogs/simoneb/archive/2007/01/06/Using-an-HttpModule-to-detect-page-refresh.aspx

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