469,589 Members | 2,085 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

Error: "The viewstate is invalid for this page and might be corrup

I have a problem with the following error:

"Server Error in '/sir' Application.
--------------------------------------------------------------------------------

The viewstate is invalid for this page and might be corrupted.
"
Page properties are: EnableViewState="True" EnableViewStateMac="False"
I don't have a Web Farm.
I want to keep DataSet in ViewState, so in Page_Load i load some data and save them in the ViewState.
But when I push some button, error occurs in OnInit method in line "base.OnInit(e);"

How can I solve this problem ?
Nov 18 '05 #1
2 1215

"Bartosz Krzywicki" <Ba**************@discussions.microsoft.com> wrote in message
news:92**********************************@microsof t.com...
I have a problem with the following error:

"Server Error in '/sir' Application.
--------------------------------------------------------------------------------

The viewstate is invalid for this page and might be corrupted.
"
Page properties are: EnableViewState="True" EnableViewStateMac="False"
I don't have a Web Farm.
I want to keep DataSet in ViewState, so in Page_Load i load some data and save them in the ViewState.
But when I push some button, error occurs in OnInit method in line "base.OnInit(e);"

How can I solve this problem ?


What exactly do you do? Just a page that posts back to itself, or are there
server.executes, server.transfers or http-handlers involved?

You did set EnableViewStateMac to false, which is the solution
for some of these problems, but apparently not for you.

Why do you want to keep a dataset in viewstate? This will mean that that
entire dataset is transported from the server to the client,
and again from client to server! How big is it?

There are several possibilities to store it server-side (session, cache).
Hans Kesting
Nov 18 '05 #2
> What exactly do you do? Just a page that posts back to itself, or are there
server.executes, server.transfers or http-handlers involved?
I post back to itself, and I have http-handlers involved
Why do you want to keep a dataset in viewstate? This will mean that that
entire dataset is transported from the server to the client,
and again from client to server! How big is it?

There are several possibilities to store it server-side (session, cache).


DataSet isn't big, but I realized (as you said) that keeping it in viewstate isn't good idea, and now I store it in Session. To save DataSet in ViewState you must save it as XML, and than you loose same informations like primary keys, constraints etc.
In Session I can store entire object.
Thanks for answer :)
Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by atse | last post: by
14 posts views Thread by sinister | last post: by
9 posts views Thread by Martin Eyles | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.