再问datagird
datagird绑定显示表1,显示的每行后面有编辑和删除按钮,编辑和删除都实现了。我希望点删除按钮,出现个提示确认的对话框,点确定才删,点取消则返回。请问这个确认的对话框怎么写?<asp:datagrid id="DataGrid1" style="Z-INDEX: 103; LEFT: 24px; POSITION: absolute; TOP: 216px"
runat="server" Height="208px" Width="448px" HorizontalAlign="Justify" PageSize="5" AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="proname" HeaderText="程序名称"></asp:BoundColumn>
<asp:BoundColumn DataField="prover" HeaderText="版本"></asp:BoundColumn>
<asp:ButtonColumn Text="详细" CommandName="Select"></asp:ButtonColumn>
<asp:ButtonColumn Text="删除" CommandName="Delete"></asp:ButtonColumn>
<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="更新" CancelText="取消" EditText="编辑"></asp:EditCommandColumn>
</Columns>
</asp:datagrid>
private void DataGrid1_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
//触发删除
string key=DataGrid1.DataKeys[e.Item.ItemIndex].ToString();
DeleteTable(key); // 根据主键值删除表中该行
}