display message box in ASP.NET when delete command is fired

N

Next

I would like to display a message box that says;

"You are about to delete this record. Is this what you want to do?"


I want to do this when the delete command is fired.

How do I do this?

Any help is greatly appreciated!

Aaron
 
A

Alvin Bruney

Here is the code is use
if((e.Item.ItemType != ListItemType.Header) && (e.Item.ItemType !=
ListItemType.Footer))

{

LinkButton deleteButton = ((LinkButton)e.Item.Cells[2].Controls[0]);

deleteButton.Attributes.Add("onClick", "event.returnValue=confirm('Are you
sure you wish to delete this item?');");

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top