E
Eric
Hi,
My page contains a select command like:
sql = "select * from mytable order by field1;"
comd = New SqlCommand(sql, connection)
etc ...
viewstate is on.
This works perfect, but when i want a random select using the command:
sql = "select * from mytable order by NEWID();", i first get the page
correctly, but when clicking on a button causing a postback, i get:
Failed to load viewstate. The control tree into which viewstate is being
loaded must match the control tree that was used to save viewstate during
the previous request.
I understand why: the button causes a postback and so there is a different
recordset coming from the table which doen't match the previous recordset.
Do you have a solution for this?
Thanks
Eric
My page contains a select command like:
sql = "select * from mytable order by field1;"
comd = New SqlCommand(sql, connection)
etc ...
viewstate is on.
This works perfect, but when i want a random select using the command:
sql = "select * from mytable order by NEWID();", i first get the page
correctly, but when clicking on a button causing a postback, i get:
Failed to load viewstate. The control tree into which viewstate is being
loaded must match the control tree that was used to save viewstate during
the previous request.
I understand why: the button causes a postback and so there is a different
recordset coming from the table which doen't match the previous recordset.
Do you have a solution for this?
Thanks
Eric