I have a gridview in which when I click edit, update, and cancel button comes. I have a variable named status. If status=false then update should change to insert and if status=true then update should be update itself. What code do I have to write in rowcammand for this? 

```
<asp:TemplateField >
    <ItemTemplate>
        <asp:LinkButton ID="lnkEdit" runat="server" CommandName="Edit" Text="Edit">                      
        </asp:LinkButton>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:LinkButton ID="lnkUpdate" runat="server" CommandName="Update" Text="Update">                      
        </asp:LinkButton>
        <asp:LinkButton ID="lnkCancel" runat="server" CommandName="Cancel" Text="Cancel">                      
        </asp:LinkButton>
    </EditItemTemplate>
</asp:TemplateField>

```