背景:在GridView中单击一行,点击删除按钮,跳出提示框是否删除XX员工。
protected void gvquery_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)//GridView控件事件 { GridViewRow gvr = gvquery.Rows[e.NewSelectedIndex]; this.lbselect.Text=gvquery.Rows[gvr.RowIndex].Cells[1].Text.Trim(); Session["selectid"] = this.lbselect.Text.Trim();//保存用户选择的对象 btsmdelete.Attributes["OnClick"] = "return confirm(‘确认删除" + Session["selectid"] + "员工吗?‘)"; }
原文:http://www.cnblogs.com/Deerjiadelu/p/7252971.html