Hello
i have the following in the page load - if not ispostback.
btndelete.Attributes.Add(
"onclick", "if(confirm('Are you sure to delete?')){}else{oEvent.cancelPostBack = true;}")
the code fires on both the Ok and Cancel button clicks. how can i trap if the user clicks the Cancel? basically I just want a confirmation window.
thanks
here is the answer for anyone coming across the same issue
1) properties - Turn off AutoSubmit
2) place the javascript in the main page<script language ="javascript">function showconfirmbox() {var button = ig_getWebControlById("WebImageButton1");if (confirm('This will DELETE the selected record from the database. Are you sure you want to delete ?' )) {button._autoSubmit =true;}else {button._autoSubmit = false;}}</script>
3) code behind file aspx.vbMe.WebImageButton1.ClientSideEvents.Click = "showconfirmbox"