To explain my situation... I am filling a listbox from a mysql table liek this
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim cmdtext = "SELECT * FROM avail_workouts"
Using conn = New MySqlConnection(connString)
Using cmd = New MySqlCommand(cmdtext, conn)
conn.Open()
reader = cmd.ExecuteReader()
While reader.Read()
ListBox1.Items.Add(reader("workout"))
End While
End Using
End Using
End Sub
I then select one of the items on the listbox and click on a button (that will do something with the value selected from the listbox) that does nothing for now. That's when I get this error
Invalid postback or callback argument.
Event validation is enabled using <pages enableEventValidation="true"/>
in configuration or <%@ Page EnableEventValidation="true" %> in a page.
For security purposes, this feature verifies that
arguments to postback or callback events originate
from the server control that originally rendered them.
If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation
method in order to register the postback or callback data for validation.
I tried using
EnableEventValidation="false"
This seemed to work, until I tried to use the selected value in the listbox. It seems to forget the value that is selected when I click on the button. So, how can I simply fill up a listbox, select a row in the listbox, and click a button where the selected value will be used without getting this error?
Thanks in advance!