1 |
1 |
<span class="kwrd">C#</span> |
1 |
<span class="kwrd">protected</span> <span class="kwrd">void</span> GridView1_RowDataBound(<span class="kwrd">object</span> sender, GridViewRowEventArgs e) |
1 |
{ |
1 |
DataRowView oDataRow; |
1 |
<span class="kwrd">string</span> sShowField, sMessage; |
1 |
LinkButton btnDelete; |
1 |
<span class="kwrd">if</span> (e.Row.RowIndex != -1) |
1 |
{ |
1 |
oDataRow = (DataRowView)(e.Row.DataItem); |
1 |
sShowField = oDataRow[<span class="str">"序號"</span>].ToString(); |
1 |
sMessage = <span class="kwrd">string</span>.Format(<span class="str">"您確定要刪除第 [{0}] 筆訂單 嗎?"</span>, sShowField); |
1 |
btnDelete = (LinkButton)(e.Row.Cells[7].Controls[0]); |
1 |
btnDelete.OnClientClick = <span class="str">"if (confirm('"</span> + sMessage + <span class="str">"')==false) {return false;}"</span>; |
1 |
} |
1 |
} |
1 |
1 |
(Visited 203 times, 1 visits today)