Click to See Complete Forum and Search --> : Prompt confirmation after button click


shaoen01
01-10-2006, 01:34 PM
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:

btnDelete.Attributes.Add("onClick", "javascript:return confirm('Are you sure you want to delete these rows?')")


Thanks

Bullschmidt
01-10-2006, 02:46 PM
Perhaps this may hopefully give you some ideas:

Classic ASP Design Tips - Delete Confirmation
http://www.bullschmidt.com/devtip-deleteconfirmation.asp