views:

17

answers:

2

Hello, i have this template field inside a gridview.

<asp:TemplateField ItemStyle-HorizontalAlign="Center">
    <ItemTemplate>
        <asp:ImageButton ID="ImageButton2" ImageUrl="~/images/DeleteRecord.gif" runat="server"
                                                                        OnClientClick="return ConfirmacionBorrarClausula();" CommandName="BorrarClausula" CommandArgument='<%#Eval("ClausulaID")%>'                                 OnCommand="gvClausulas_OnRowDeleting" CausesValidation="false"  
    </ItemTemplate>
</asp:TemplateField>          

I have another one in the same page but in a different gridview, almost exactly like this one but the second one isn´t working.

So i have two gridviews each one with a template field like the one here, one onRowDeleting working perfectly, the other one not working at all, when i click it, it asks for confirmation (javascript function) but when i click ok to delete, the grid loses it data and the page fires all the validators.

Thank you for your time.

A: 

Make sure the control IDs are set right. And Ispostback the control level set to true. And also Try deleting the control and add it again some time that might help. Try add it from design view.

i manage to solve it, the problem was the second gridview was losing its data on the pageload, i managed that but only with the first gridview.Thanks for your time my friend.
rolando
A: 

i manage to solve it, the problem was the second gridview was losing its data on the pageload, i managed that but only with the first gridview.

rolando