I am using the following C# to replace the texts 'Edit, Delete and Select' from the command row on GridViews.
I want to improve this by using a javascript 'confirm' dialogue to make the user double check before deleting a row. How can I do this from the LinkButton object?
private void commandIcons(GridViewRow row)
{
if (row.Cells[0].Controls.Count == 5)
{
// we have a edit delete select control row type, replace text labels with icons
LinkButton lbedit = (LinkButton)row.Cells[0].Controls[0];
lbedit.Text = lbedit.Text == "Edit" ? "<img title=\"Edit\" class=\"icon\" src=\"Images/database_edit.png\" />" : lbedit.Text;
LinkButton lbdelete = (LinkButton)row.Cells[0].Controls[2];
lbdelete.Text = lbdelete.Text == "Delete" ? "<img title=\"Delete\" class=\"icon\" src=\"Images/delete.png\" />" : lbdelete.Text;
LinkButton lbselect = (LinkButton)row.Cells[0].Controls[4];
lbselect.Text = lbselect.Text == "Select" ? "<img title=\"Select\" class=\"icon\" src=\"Images/accept.png\" />" : lbselect.Text;
}
}