ASP.NET GridView OnRowDeleted

时间:2015-10-14 05:58:39

标签: asp.net webforms

我有CodeBehind

 protected void gvAll_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        KB.DeleteConstant(e.Keys[e.RowIndex]);
        gvMaster.DataBind();
    }

    protected void gvMaster_RowDeleted(object sender, GridViewDeletedEventArgs e)
    {
        Session["MasterBound"] = false;
        gvMaster.DataBind();
    }

和aspx

 onrowdeleted="gvMaster_RowDeleted" 
                            onrowdeleting="gvAll_RowDeleting">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>

                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                    CommandName="Edit" Text="Edit"/>
                                <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                                    CommandName="Delete" Text="Delete"/>
                            </ItemTemplate>

当有人点击删除时,有人可以解释为什么onitemdeleted事件不会引发吗?

0 个答案:

没有答案