0

I have a linkbutton that works fine just one time, the second click does not respond in Chrome but it works in Internet Explorer. This only happens in my production environment, but dev works fine.

While debugging, I can tell that is not reaching my linkEdit_Click Sub.

I tried with EnableViewState="false" and it didnt work.

I've changed the way of how linkEdit_Click is called, with CommandArgument in the gridview and changing the OnClick for OnCommand.

In DevTools I notice a 403 forbidden error in the second click but I dont know how to fix it

My code is something like this:

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">        
    <ContentTemplate>
        <asp:GridView ID="grid1>
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:LinkButton ID="linkEdit" runat="server" 
                         Text="Update" OnClick="linkEdit_Click" CausesValidation="false">
                       </asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>                    
            </Columns>
        </asp:GridView>
    </ContentTemplate>        
</asp:UpdatePanel>

Code behind:

Protected Sub linkEdit_Click(sender As Object, e As EventArgs)            
    _presenter.Edit(sender)            
End Sub
Zendik73
  • 5
  • 4

1 Answers1

0

ASP HTML Code, change to 'CommandName' instead of OnClick because you are using LinkButton property.

<asp:LinkButton ID="linkEdit" runat="server" Text="Update" CommandName="edit" CausesValidation="false">

Codebehind use this function to trigger the Command.

Private Sub grid1_rowEditing(Byval sender as Object, Byval e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles grid1.RowEditing
  grid1.EditIndex = e.NewEditIndex
End Sub


Private Sub grid1_RowCommand(byval sender as Object, Byval e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles grid1.RowCommand
  if e.CommandName = "edit" Then
    '' Do something here
  end if
end sub
Paan Joe
  • 37
  • 2
  • 7
  • Hi, ty for responding. Sadly, ths didn't work either. Same thing, works one time, and then the second click make the UpdateProgress, stops , and nothing. – Zendik73 Apr 11 '19 at 15:47
  • @Zendik73 Hi, when you debug in chrome dev tools, what is the error message at the console tab and network tab. Could you update that to me? – Paan Joe Apr 12 '19 at 04:10