Thursday, September 4, 2008

comform message in datalist & Repeter

Use this code in the Datalist or Repeter itemDataBound Event....

if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{

ImageButton db = (ImageButton)e.Item.FindControl("imgbtnDelete");

// Assign the Delete button's OnClientClick property
db.OnClientClick = string.Format("return confirm('Are you sure you want to delete this topic?');");
}

No comments: