首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

怎么在删除gridview的一行数据前,弹出一个提示

2012-05-03 
如何在删除gridview的一行数据前,弹出一个提示C# code private void InitializeComponent(){this.GridView

如何在删除gridview的一行数据前,弹出一个提示

C# code
 private void InitializeComponent()    {      this.GridView1.DataBound += new System.Web.UI.WebControls.GridViewRowEventHandler(this.GridView_RowDataBound);    }
 
各位兄弟,为什么这句会提示错误:
无法将类型“System.Web.UI.WebControls.GridViewRowEventHandler”隐式转换为“System.EventHandler”呢?

不加这句, protected void GridView_RowDataBound(object sender, GridViewRowEventArgs e)
又不会执行。。。

就想在删除gridview数据前 弹出一个提示。。

[解决办法]
C# code
 <asp:LinkButton ID="lbtnDelete" runat="server" Text="删除" Font-Underline="true" CommandName="Del"                                    CommandArgument='<%#Eval("UID") %>' OnClientClick='javascript:return confirm("确定要删除嘛?");'></asp:LinkButton>
[解决办法]
LZ贴全点代码

热点排行