I wish to add an attribute to the button click in asp.net to prompt a confirmation box using javascript. Also, is it possible to perform a function after a button click before i prompt the confirmation box? This function will return a value indicating whether i should prompt the confirmation box.
I know i should add a code as shown below but it does not work somehow:
Code:
btnDelete.Attributes.Add("onClick", "javascript:return confirm('Are you sure you want to delete these rows?')")
Thanks