日期:2012-07-26  浏览次数:20976 次

触发javascript事件
public static void DG_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
LinkButton l=new LinkButton();
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem )
{
l = (LinkButton)e.Item.Cells[0].FindControl("del");
l.Attributes.Add("onclick", "return Delete();");
}
}