Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

confirm delete in datagrid

Status
Not open for further replies.

slatet

Programmer
Sep 11, 2003
116
US
We're having some difficulty with getting the confirmation box to work with the datagrid. We have found examples in tek tips but could not get it to work for us.

Here is the HTML for the delete command:
<asp:ButtonColumn HeaderStyle-CssClass="grid-header" Text="Delete" CommandName="Delete"></asp:ButtonColumn>


And this is what we tried based on an article on this site:
private void ctrlDataGridUsersRoles_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
((Button)e.Item.FindControl("Delete")).Attributes.Add("onClick", "javascript:return confirm('Are You Sure You Wish To Delete This Item ?');");
}


We feel that we are close. If you have any suggestions, we appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top