//報(bào)警刪除
protected void gridViewDxjk_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string key = gridViewDxjk.DataKeys[e.RowIndex].Value.ToString();
bool flag = bll.Delete(Int32.Parse(key));
if (flag)
NXT_WLService.App_Code.JScript.Alert("刪除成功!", this);
else
NXT_WLService.App_Code.JScript.Alert("刪除失敗!", this);
}
protected void gridViewDxjk_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
LinkButton btn = (LinkButton)e.Row.Cells[1].Controls[0];
if (btn.Text.Equals("刪除"))//刪除鈕才加提示訊息
btn.OnClientClick = "if (confirm('你確認(rèn)要?jiǎng)h除?')) javascript:__doPostBack('gridViewDxjk','Delete$" + e.Row.RowIndex.ToString() + "'); else return false;";
}
}