//必須先將刪除button轉成樣板,在數據綁定時,提供一組屬性給delete button

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button myBtn = e.Row.Cells[2].FindControl("Button1") as Button;
myBtn.Attributes.Add("onclick", "return confirm('您確定要刪除資料嗎?')");
}

文章標籤
全站熱搜
創作者介紹
創作者 ylw1125 的頭像
ylw1125

程式搜集分享精靈

ylw1125 發表在 痞客邦 留言(0) 人氣(393)