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

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

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

 

        
3条回答
  •  不要未来只要你来
    2021-01-23 09:58

    Try this, if this is the only button that has this behavior

    Button2.Attributes.Add("onclick", "return confirm('Are you sure you want to proceed?')");
    

    it's inline and looks straightforward but if you have multiple controls that behave this way then your original approach would be easy to maintain.

    And your original function could be shrunken to

      
    

提交回复
热议问题