Data Browser - Viewing Site  Sector 23 Code Bank Logged in as:  Guest  




           


Add Prompt on C# Webpage
When a user clicks a button, you probably want to confirm that they meant to click it. Especially if the button's Text is "Delete Database". Here's about the simplest check you could do:

myDeleteButton.Attributes.Add("onClick", "return confirm('Are you sure you wish to delete the database?');");

The user will see "Ok" and "Cancel". If the user doesn't choose 'Ok', the operation is canceled.

Created By: amos 3/20/2006 12:12:59 AM