"simon" <si*********@stud-moderna.si> wrote in message news:uW**************@TK2MSFTNGP12.phx.gbl...
I have page search.asp. When I click button, I submit form with script:
form1.action="searchResults.aspx"
form1.submit
On page searchResults.aspx I get the following error message:
The viewstate is invalid for this page and might be corrupted.
Does anybody know why?
Thank you,
Simon
I guess it is because you submit (probably via POST) to an aspx:
that aspx then expects a "postback", so tries to read the viewstate,
which normally is sent via a hidden input.
That input is not present (or not valid), therefore you get this error.
There is a way around this: you can set the directive
<%@ Page EnableViewStateMac="false" %>
in your aspx file.
I noticed you are trying to post from an asp to an aspx. (or is that a typo?)
The "usual" way for asp.net is to have an aspx page post to itself.
(then you won't have those viewstate problems)
Hans Kesting