ASP.NET OnClientClick=“return false;” doesn't work

后端 未结 7 1146
鱼传尺愫
鱼传尺愫 2020-12-18 23:55

I just want to add some client side (JQuery Javascript) validation in a web user control. I put an OnClientClick handler and the function gets called. BUT, even if I return

7条回答
  •  北海茫月
    2020-12-19 00:08

    Do you have a click event handler (registered via jquery) which returns true? In that case, the return value of OnClientClick is ignored.

    Have a look at my question (and answer): Why doesn't returning false from OnClientClick cancel the postback

提交回复
热议问题