欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp.net GridView的刪除對話框的兩種方法

 更新時間:2009年04月13日 11:46:34   作者:  
本來這兩種方法,我已經(jīng)掌握。但是沒有總結(jié),今天朋友突然問題,我竟然想不起來,找了半天,現(xiàn)在亡羊補(bǔ)牢,趕快寫在博客里。
1、
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//如果是綁定數(shù)據(jù)行
if (e.Row.RowType == DataControlRowType.DataRow)
{
if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate)
{
((LinkButton)e.Row.Cells[9].Controls[0]).Attributes.Add("onclick", "javascript:return confirm('你確認(rèn)要刪除:\"" + e.Row.Cells[1].Text + "\"嗎?')");
}
}
}
2、<div id="de" onclick="JavaScript:return confirm('確定刪除嗎?')">刪除</div>

相關(guān)文章

最新評論