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

G

Guest

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 ?
 
H

Hans Kesting

Bartosz Krzywicki said:
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
 
G

Guest

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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top