读书人

怎么在删除gridview的一行数据前弹出

发布时间: 2012-05-03 14:06:56 作者: rapoo

如何在删除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贴全点代码

读书人网 >C#

热点推荐