I found something that works for me on the web after much looking.  In Page_Load, just add the 2 lines:

ibtnDelete.Attributes.Add(“language”, “javascript”)

ibtnDelete.Attributes.Add(“OnClick”, “return confirm(‘Are you sure you want to delete this record?’);”)

This will bring up an OK/Cancel box when the button is clicked; if Cancel is then clicked the button’s click event code won’t run.


Advertisements