OnClick not working when i use both Onclick & OnClientClick

前端 未结 5 1597
抹茶落季
抹茶落季 2020-12-09 19:17

With this code, i try to Close a Window (the way i\'m doing it works) but i have also an Onclick event which is ignored!



        
5条回答
  •  离开以前
    2020-12-09 19:53

    This article kind of explains the problem. You need to return true in your JS if you want the server event to trigger. Otherwise, you have to return false.

    And, it also looks like you will have to add the UseSubmitBehavior = false based on: OnclientClick and OnClick is not working at the same time?

    This is especially evident after seeing that your generated HTML only has the CloseDialog() and not the call to Button1_Click. This change will concatenate to the end of your onclick.

    
    

提交回复
热议问题