Prevent LinkButton post back OnClientClick not working. Why?

前端 未结 4 1650
天涯浪人
天涯浪人 2020-12-02 00:37

I know there are plenty of answers surrounding this topic but I just cannot get this to work.

I need to prevent a link button posting back and the following code is

4条回答
  •  自闭症患者
    2020-12-02 01:28

    Add Return statement in onClientClick Javascript Event

    OnClientClick="return showConfirm(event);"
    

    So when showConfirm return false then request will not be transer to server and page not postback.

提交回复
热议问题