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;}";
           }
       }
 
 

原文網址

arrow
arrow
    文章標籤
    SPAN 靠右
    全站熱搜

    jason0324 發表在 痞客邦 留言(0) 人氣()