代码是这样的:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="388px" OnRowCommand="GridView1_RowCommand" >
<Columns>
<asp:BoundField DataField="id" HeaderText="id"/>
<asp:BoundField DataField="title" HeaderText="title"/>
<asp:BoundField DataField="fb_time" HeaderText="fb_time"/>
<asp:ButtonField Text="删除" CommandName="del" />
<colums>
</asp:GridView>后台:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "del")
{
int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridView1.Rows[index];
int deleteid = Convert.ToInt32(row.Cells[0].Text.ToString());
string delcmd = "delete from table where id=" + deleteid;
delete.....
} 现在想有个确认弹出框,该怎么加代码。
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="388px" OnRowCommand="GridView1_RowCommand" >
<Columns>
<asp:BoundField DataField="id" HeaderText="id"/>
<asp:BoundField DataField="title" HeaderText="title"/>
<asp:BoundField DataField="fb_time" HeaderText="fb_time"/>
<asp:ButtonField Text="删除" CommandName="del" />
<colums>
</asp:GridView>后台:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "del")
{
int index = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridView1.Rows[index];
int deleteid = Convert.ToInt32(row.Cells[0].Text.ToString());
string delcmd = "delete from table where id=" + deleteid;
delete.....
} 现在想有个确认弹出框,该怎么加代码。
解决方案 »
- 哪位高手帮帮忙?!!!
- ASPX中,如何将EXcel中的数据导入到gridview里去,以及为什么用gridviewexporter导出后,页面会自动关闭。
- 在线等,求救,急死人了,IE FF 打开网页有时候进度条不动,但状态栏却一直显示正在打开,但却显示不了页面
- 帮我看看
- ie缓存的解决方法
- 求SharpDevelop的源代码的下载地址!急,谢谢!
- 一个DATAGRID绑定数据的小问题。只是想问一下写码方式。
- FileUpload的问题,想利用他向数据库中插入图片的路径(在线等 谢谢!)
- 我在 asp.net 和 C# 编写的 Web 页面中,我想调用外部应用程序如同VB 中的Shell 如何解决。
- 文件下载问题
- 初学者问关于xsl问题.
- 提问一个页面重指向的问题
控件ID.Attribute.Add("onclick","return confirm('确定要删除吗?');");