I have a gridview in an asp.net 4.0 website.
I have a link button in the gridview that sends a command name to the code behind RowCommand event. The link button also has an OnClientClick event that does a confirmation.
The issue is that after the confirmation box is confirmed, the row command cannot find the index from the command arguments. The command name is sent successfully but not he arguments.
The error states, "Input string was not in a correct format."
'gridview linkbutton code
<asp:LinkButton ID="LinkButton2" Runat="server" OnClientClick="return confirm('Are you sure you want to delete this fish?');" CommandName="ConvertRow">Convert</asp:LinkButton>
'codebehind code that fires the error
Dim index As Integer = Convert.ToInt32(e.CommandArgument)