?
Solved

Invalid Viewstate

Posted on 2009-07-03
4
Medium Priority
?
418 Views
Last Modified: 2012-05-07
My application is .net 2.0.  I have around 40 sites running the same app for multiple customers.  I get intermittant invalid viewstate errors that affect stability of the app.  I have researched this, but not found a solution.

1. The app is running on my own server.
2. I use NLM, but only one server is active.  It is for backup purposes to redirect to a backup server.
3. I am on .Net 2.0
4. I have added a machine key to the web.config for all sites (below).  This didn't make a difference.
5. From my application log, I see the error (at least sometimes) happens on the initial post to a form.  For example, I click on a menu link to open a new form, and I get the error.
6. I don't have any anti-virus software running on the server.
7. The error happens too often to assume that is is a App Pool recycle error.

There is a lot written about this error, but I can't seem to find the issue.  Help!
<machineKey validationKey="1111111111111112CAD731F96F1ABC096D05090C9AD6623AB99C56ADB7E774045CC6AD2D86A24FD8BE8BA19E809E35ACA5BAD28B4762EC126471BA373CB28628"
                decryptionKey="30866BB7F1D1B392A17F675CD6425C83FB90351365D82AA5" 
                validation="SHA1" />
 
Some values were changed for this post

Open in new window

0
Comment
Question by:No1Coder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 39

Expert Comment

by:abel
ID: 24937060
Sometimes there's only so much you can do. Once I remember having a similar problem and after hours of research I found out that when I did a forced redirect with NoStore header set, all went fine. Not a nice solution, but it at least took away the errors from the clients.

Later I found out that there was one control (a label in my case) that disrupted the process. Apparently the label state was remembered in the viewstate. By disabling the viewstate for a few specific controls I managed to stop the error.

Not sure if this approach is something for you, but it may be a workable solution if you do not want to lower your security to something that allows the passing of these viewstates. You can catch the error globally through either global.asax or registering a thread error handler.

-- Abel --
0
 
LVL 20

Expert Comment

by:informaniac
ID: 25012845
Have u used Client Callback anywhere in ur application?

Or are using javascript to call a server side event. say button click?
0
 

Accepted Solution

by:
No1Coder earned 0 total points
ID: 25013455
I worked with Microsoft on this.  Moving the page_load code to page_init helped.  Also, turning off viewstate on some grids helped.  I can;t say it is fixed, but the number of instances have been greatly reduced.
0
 
LVL 39

Expert Comment

by:abel
ID: 25016777
They haven't been able to pinpoint one particular problem or issue in your code that caused this erratic behavior? Must be quite disappointing, though glad to hear that you got it partially resolved.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question