Get the return confirm popbox value in asp .net C#

后端 未结 3 971
遇见更好的自我
遇见更好的自我 2021-01-23 09:10

How can i get the value that was pressed in the confirm box?

 

        
3条回答
  •  醉话见心
    2021-01-23 09:50

    I just face similar problem in a real production project and I solved it by the following:

    
    

    so the OnClientClick Client event is raised befoere the onClick which is a server event , so if the user clicks OK then the Client event returns True from the confirm Dialog and therefore the Code Behind this button is executed , on the other hand if the user clicks (Cancel or No) then it would return false and therefore the code behind wont get exected (Server Event is Cancelled)

    hope it would help you as I really applied it to my project and worked without any issues.

提交回复
热议问题