I am trying to delete a row in gridview using an imagebutton like this

```
                        <asp:TemplateField>
                        <ItemTemplate>
                            <asp:ImageButton ID="imgDelete" CssClass="gridColumnDelete" runat="server" ImageUrl="~/Imgs/Delete.png" AlternateText="Delete"  
                            CommandName="Delete" CommandArgument="<%#((GridViewRow)Container).RowIndex %>"/>
                        </ItemTemplate>
                    </asp:TemplateField>

```

I have written jQuery dialog for confirmation of delete like this

```
$(document).ready(function () {
confirm();
    });

    function confirm() {
        $(".gridColumnDelete").click(function () {
            $("#dialog-confirm").dialog({
                resizable: false,
                height: 140,
                modal: true,
                buttons: {
                    "Yes": function () {
                        __doPostBack(); 
                        $(this).dialog("close");
                    },
                    Cancel: function () {
                        $(this).dialog("close");
                    }
                }

            });
        });
        return false;
    }

```

the div tag used for dialog is this

```
 <div id="dialog-confirm" title="Confirm?" style="display:none">
<p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>Are you sure to delete the trip?</p>
</div>

```

the problem is whether i click Yes or cancel in dialog the Gridview\_RowCommand is executed in c#.

In fact Gridview\_RowCommand is executed even before i click on any button in the confirmation dialog