日期:2014-05-18  浏览次数:20739 次

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