No 30 · 在gridview控件上添加删除确认

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            ((LinkButton)(e.Row.Cells[0].Controls[0])).Attributes.Add("onclick", "return confirm('确定删除吗?')");
        }
    }


你可能感兴趣的:(object)