C#
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
DataRowView oDataRow;
string sShowField, sMessage;
LinkButton btnDelete;
if (e.Row.RowIndex != -1)
{
oDataRow = (DataRowView)(e.Row.DataItem);
sShowField = oDataRow["序號"].ToString();
sMessage = string.Format("您確定要刪除第 [{0}] 筆訂單 嗎?", sShowField);
btnDelete = (LinkButton)(e.Row.Cells[7].Controls[0]);
btnDelete.OnClientClick = "if (confirm('" + sMessage + "')==false) {return false;}";
}
}
文章標籤
全站熱搜
留言列表