Loading

【转】asp.net2.0中gridView的删除确认问题

asp.net2.0中gridView的删除确认问题
 

用惯了datagrid,第一次用gridView,倒有点不习惯.写删除确认时还有点不习惯,经过一番折磨,gridView的删除确认可以这样写:

 

if (e.Row.RowType == DataControlRowType.DataRow)
        
...{
            e.Row.Cells[
0].Attributes.Add
                           (
"onclick""javascript:return confirm('确定删除?')");
        }

 

把上面这段放在GridView1_RowDataBound事件里或GridView1_RowCreated里都可以. 

posted @ 2008-07-01 21:56  .net's  阅读(453)  评论(0)    收藏  举报