469,117 Members | 1,294 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,117 developers. It's quick & easy.

The viewstate is invalid for this page and might be corrupted.

hi to all
does any body know or receive this message before
and how i can repare this:

The viewstate is invalid for this page and might be corrupted.
thank's
Mike

Nov 18 '05 #1
2 2291
This generally happens if you try to transfer to a different page. The
viewstate is transferred to the new page and does not match up against the
controls on the new page. Are you trying to transfer control to a different
page?

"Mike" <bl****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
hi to all
does any body know or receive this message before
and how i can repare this:

The viewstate is invalid for this page and might be corrupted.
thank's
Mike

Nov 18 '05 #2
I did plenty of server.transfers to different pages. It
doesn't force the posted viewstate onto the transferred
page AFAIK. You can access the original page properties
and viewstate from the target page using the
Context.Handler and typecasting the original page class on
it to get its values/viewstate if you somehow know what
the original page class is(you can pass some kind of
parameter in the querystring when doing server.transfer
for this purpose)

in class Search: Page
....
Server.Transfer("Results.aspx?fromPage=Search");
....

in class Results: Page

if(Request.QueryString["fromPage"]=="Search")
{
Page pageThatTransferredToMe = (Search)Context.Handler;
//now you can get to the originally loaded page properties
}

Anyway, I usually get that error when I add/remove server
controls in an aspx/ascx file while having the page open
in the browser. If you do this and try to submit the page,
click something, you will get this error because the
version page you're submitting had a different set of
server controls thus a different viewstate than the
version of the page that's trying to load the submit
viewstate. You only have to reload the page(enter it again
in the adress bar) instead of submiting it...

You could be getting this error for some other reasons
though... a bit of code or something might be helpful...
Perhaps you corrupted the viewstate hidden input or the
form with javascript or modified the LoadViewState process
somehow... who knows...
-----Original Message-----
This generally happens if you try to transfer to a different page. Theviewstate is transferred to the new page and does not match up against thecontrols on the new page. Are you trying to transfer control to a differentpage?

"Mike" <bl****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
hi to all
does any body know or receive this message before
and how i can repare this:

The viewstate is invalid for this page and might be corrupted. thank's
Mike

.

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Anup Jishnu | last post: by
4 posts views Thread by Rob Reckless | last post: by
2 posts views Thread by sarvjeet Saini | last post: by
5 posts views Thread by Anup Jishnu | last post: by
1 post views Thread by Mind Dragon | last post: by
1 post views Thread by S S Venkatesh | last post: by
1 post views Thread by Hillary Hill | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.