Monday 26 February 2007

Asp.Net Adding a javascript confimation message box to button click

To add a javascript confimation (message) box to the click of a button add the following to the Page_Load():

btnDelete.Attributes["onclick"] = "return confirm('Are you sure you want to delete this record?');";