简体   繁体   中英

Is there a way to prevent postback?

As a continuation to as written here: Click on a button pauses other function interval

I've realized that clicking on a button / calling a JS function causes a postback, and it might be the reason that it is not possible to do them both together.

Is there any way to prevent this postback?

You can try the following to stop the postback...

<asp:Button runat="server" ID="UpdatePlayersInPartyBTN" OnClientClick="javascript: return false;" onclick="UpdatePlayersInParty" />

Or

You can remove the runat server if you don't need it.

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