Click here to Skip to main content
16,018,460 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am developing ASP.NET application with C#.
I am having Page1.aspx as a parent Page. When i click a button on Page1.aspx, another page Page2.aspx as a child window opens.
I am passing selected rows of gridview from page2 to page1. Also I m getting some values in page1 from another page through Reques.querystring.

But I am getting the exception:
Invalid ViewStste Or ViewState might be corrupted.
How to fix this error?
Posted
Updated 28-Jun-10 20:13pm
v4

Generally, This problem occurs because the EnableViewStateMac attribute of the page element or page directive at the top is set to true by default.

If this doesn't help then:
Viewstate are values of page controls, stored in a hidden field,
that is sent back to the server. It is unlikely a client error until your way of passing values from page 2 and Page3 to page1 are not handled properly.

Look at the following links to make sure environment is fine:
http://support.microsoft.com/kb/829743[^]
http://bytes.com/topic/asp-net/answers/286631-viewstate-invalid-page-might-corrupted-problem[^]
 
Share this answer
 
v2
If you are using Databound controls such as GridView/FormsView/DetailsView. When any of these controls is in edit mode in your page. Once the control is in edit mode. It should be changed to readonly mode. other wise invalid view state error message will be displayed.
I have encountered such issues in my project due to mode change of data bound controls.

Edit: removed inappropriate PRE tags.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900