I am trying to pass values inside a repeater by tying them to a button and passing them from this form to another form. When I compile this, it gives me an error indicating
System.FormatException: Input string was not in a correct format.
Button in Repeater code in 1.aspx format:
<asp:Button ID="Button1" runat="server" Text="" CommandName= "TEST" CommandArgument = '<%# Eval("Parking_ID") + "," + Eval("Parking_Name") %>' />
in form1.aspx.vb Repeater_ItemCommand Function:
Protected Sub repeater1_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.RepeaterCommandEventArgs) Handles repeater1.ItemCommand
If (e.CommandName = "TEST") Then
Dim commandArgsAccept As String() = e.CommandArgument.ToString().Split(New Char() {","c})
Dim value As Int32 = commandArgsAccept(0).ToString
Dim value1 As String = commandArgsAccept(1).ToString
Response.Redirect("Default2.aspx?Parking_ID=" & value, True)
Response.Redirect("Default2.aspx?Parking_Name=" & value1, True)
Session("field4") = value
Session("field6") = value1
End If
End Sub
Any solution to this problem? Sincerely.
Hhbib source
share