javascripting to datagrid
-
hello friends, I am using datagrid to list my items. I am using sqldatasource for this. but while deleting record, i want to add confirmation javascript before delete? Is it possible on datagrid?
Amit
-
hello friends, I am using datagrid to list my items. I am using sqldatasource for this. but while deleting record, i want to add confirmation javascript before delete? Is it possible on datagrid?
Amit
Here is an example that should point you in the right direction. In the aspx page (datagrid property) add onItemDataBound = "itemDataBound" Codebehind should be something like this. protected void itemDataBound(object o, System.Web.UI.WebControls.DataGridItemEventArgs e) { if((e.Item.ItemType == ListItemType.Item) || (e.Item.ItemType == ListItemType.AlternatingItem)) { LinkButton lb = (LinkButton)e.Item.FindControl("lLinkButton"); lb.Attributes.Add("onClick", "return confirm('Are you sure want to delete ?')"); } }
I didn't get any requirements for the signature