views:

43

answers:

1

Hi,

I need to dispaly a message box for confirmation to delete an Item or not but not sure how to do that if I use javascript alert, than how will I get confirmation??

+3  A: 

You could use the confirm function:

if (confirm('Are you sure you want to delete this item?')) {
    // TODO : the user confirmed
}

As you've tagged your question with ASP.NET:

<asp:LinkButton 
    ID="DeleteButton" 
    runat="server"
    CommandName="Delete" 
    Text="Delete"
    OnClientClick="return confirm('Are you sure you want to delete this item?');" 
/>
Darin Dimitrov
Hey Thanks Man :)
BreakHead