473,790 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invalid_Viewsta te

I have a production asp.net application that is getting seemingly random
Viewstate errors.

It is a single server, so there isn't any issue with posting viewstate to a
different server that what it was received from. Also, it happens with users
that have to go through a firewall and users that don't.

It happens across the a broad array of pages, most of them are simple grid
pages that you can drill down into to collect more input data.

Also, the viewstate size is typically 5-30K depending on the page. Never
gets anywhere near 1024K.

We have also installed sp1 for the 1.1 release of the .net framework, so we
can collect more detailed viewstate errors.

I'll post the most typical error that we get in a follow up message.

If anybody knows what actually causes this I would be very interested in
knowing. A resolution would be even better.

Chris Sutton
Nov 19 '05
29 8467
P.J
As for an example of the key I used, here is the section in system.web
of the machine.config file:

<machineKey
validationKey=" 501CCD40823C2A6 27CEDD026581211 B94DF5EF821008B 6149BA4E6EE73A2 D0B1E27E3297044 1D954F1CEF1870C A5FD5EAAD4E8377 6CE2B5B5FD9F0A6 661FB91E"
decryptionKey=" 0BA0B07AB3E6971 4D0D387AE74E92A DD4B7BB70DB79EB 478"
validation="SHA 1"/>

(the validationKey is on one line)

Nov 19 '05 #21
Can someone who has this problem fixed give the exact steps needed to
eliminate the problem. It seems several solutions were mentioned, but
not enough details were layed out.

Thanks,

Nov 19 '05 #22
That's good stuff, i'll push this out to MSDN as a solution. P.J. send me
your full name if you require credit for the solution va******@hotmai l.com
subject line Invalid Viewstate

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"P.J" <pj*********@sn clavalin.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
I successfully tested the solution by adding a key in the
machine.config file of the server.

I use this link to make a small console application (in C#) to generate
a key (SHA1):
http://support.microsoft.com/default...;en-us;Q312906

Then I updated the machine.config file under the system.web section
with the output produce and tried to make the Invalid_Viewsta te error
come up again. But it didn't show up, so it is an acceptable solution
for us.

I agree that on a commercial hosting server, this solution might not be
appropriate since every web site will share the same key. I have no
answer for that beside disabling the application pool 'health' feature,
but then, you lose the advantage of using Windows 2003 and IIS 6.

Nov 19 '05 #23
Unfortunately, I tried this solution out for my scenario and it does not
work. Here is what my application is running on:

- Windows 2003 HyperThreaded II6 Server
- Application Pool's identity is user account
- Using FormsAuthentica tion
- Using Server.Transfer to go from page to page taking advantage of
performance gains and the Context to pass query values between pages.

If I disable the EnableViewState Mac in my web.config, I am no longer
running into this problem. What is interesting is that I had the same
application running on another Windows 2003 machine about 4 months ago
and it did not error out like this. The only difference between the
current one and the old one is that the current one is HyperThreaded.

The machine key solution might work for Web Farm scenarios but not
regular sites running on a shared production box at a web hosting
company.


*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #24
P.J
There are 3 possible solutions to this problem:

1st solution: Disable the application pool idle worker process shutdown
via IIS 6.0 console | <your_applicati on> properties

2nd: I think the code snippets provided by danpak6 persist the
viewstate so it stays available on subsequent hit

3rd: In the machine.config file of your server, in the system.web
section, change the validationKey setting from the default (which is
Autogenerate) to a permanent key you generated (see above post to make
the tool that will generate one for you).

I think that sums it all.

Nov 19 '05 #25
Of the three solutions you suggested, none of them work.

1st solution: Disable the application pool idle worker process shutdown
via IIS 6.0 console | <your_applicati on> properties

-- Did that under the Performance tab, recycled the application pool,
still the error persists.

2nd: I think the code snippets provided by danpak6 persist the viewstate
so it stays available on subsequent hit

-- Although this was not giving any error, the application was behaving
oddly. It would keep logging me out when it usually three the Invalid
ViewState error otherwise. Then accessing a secured area, I would
automagically be logged in again.

3rd: In the machine.config file of your server, in the system.web
section, change the validationKey setting from the default (which is
Autogenerate) to a permanent key you generated (see above post to make
the tool that will generate one for you).

-- This is the solution, in my previous reply I mentioned does not work
(possibly in a non-web farm environment).

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #26
>Did that under the Performance tab, recycled the >application pool,still
the error persists. You should manipulate the settings so that the application does not recycle.
This is not what you have said.
--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
--------------------------------------------------
"Huzaifa Tapal" <hu***********@ aidenblerb.com> wrote in message
news:O0******** ******@TK2MSFTN GP14.phx.gbl... Of the three solutions you suggested, none of them work.

1st solution: Disable the application pool idle worker process shutdown
via IIS 6.0 console | <your_applicati on> properties

-- Did that under the Performance tab, recycled the application pool,
still the error persists.

2nd: I think the code snippets provided by danpak6 persist the viewstate
so it stays available on subsequent hit

-- Although this was not giving any error, the application was behaving
oddly. It would keep logging me out when it usually three the Invalid
ViewState error otherwise. Then accessing a secured area, I would
automagically be logged in again.

3rd: In the machine.config file of your server, in the system.web
section, change the validationKey setting from the default (which is
Autogenerate) to a permanent key you generated (see above post to make
the tool that will generate one for you).

-- This is the solution, in my previous reply I mentioned does not work
(possibly in a non-web farm environment).

*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #27
P.J
In the Performance tab, uncheck the "Idle timeout" checkbox. By
default it is at 20 minutes, but unchecking it will leave it in memory
and no shutdown (recycling) will happen again. Then, the the Recyling
tab, uncheck any 'recycling' option that are set.

Note: if you are connected to your site, make changes to the
application pool setting, and then continue to browser, you might have
the error since the worker process did recycle when you applied the
settings to the pool. But from a fresh new session, you shouldn't
received the error.

Hope that will you better!
P.J

Nov 19 '05 #28
Hi Huzaifa Tapal,

The unofficial solution is to set the enableViewState Mac property to
True on the page you'll be transferring to, then set it back to False.
This records that you want a definitive False value for this property
and resolves the bug.

Best,

Daniel

Nov 19 '05 #29
Well turning off the recycling options and the idle timeout still did
not work. The wierd thing is that this only happens after doing
Server.Transfer and after Forms Authentication.

Turning the EnableViewState Mac to false fixes the problem, however,
since that is not reccommended I want to find a better solution to this.

I am surprised Microsoft is not doing anything about this. I believe
this is a huge bug in ASP.NET

*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #30

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1933
by: Jennyfer J Barco | last post by:
Hello I'm sending this again since I didn't have any answer 5 days before I sent this e-mail. Hello, Sometimes I'm getting this Application error: Error:Invalid_Viewstate Client IP: 10.0.2.238 Port: 4436 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR
2
271
by: Arne | last post by:
The errror message System.Web.HttpException: Invalid_Viewstate has increased in frequency since I moved from Windows 2000 server to Windows 2003 server. Now I may get 16 of these errors a day compared to a few a week. What can I do about this error?
3
15554
by: some one | last post by:
I have kind of wired problem, I using httpwebrequest to post form data to server , in the GetResponse stage a WebException occurred, after tracing the actual error that occurs on the server, I found the follows. Invalid length for a Base-64 char array. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about
1
2151
by: dima | last post by:
Hi All, I know some of you had this problem in production. Did anyone find out how to fix this problem or what is the cause of it? System.Web.HttpException: Invalid_Viewstate System.Web.HttpException: Authentication of viewstate failed. 1) If this is a cluster, edit <machineKey> configuration so all servers use the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. 2) Viewstate can only be posted...
2
1700
by: InnoCreate | last post by:
Hi Everyone, Occasionally i'm getting the following error logged. I've heard this can be caused by proxy servers. Does anyone know anyways to resolve the issue or anything else that could cause the issue. Thanks James
1
2199
by: Bill Sempf | last post by:
Trying again on this forum to see if anyone has seen this error: I am receiving an Invalid_Viewstate error on one of my sites, and the error message content has SMTP Mail header text in it! Here is an example from my exception handler: --------------------------------------------------------- Date: 3/27/2006 3:18:09 AM
1
5056
by: adrian.besimi | last post by:
Hi, I got a serious problem regarding the Server.Execute and/or Server.Transfer. Here's the idea of my application: I have 1 web page named Default.aspx where I execute all my other pages.
1
1928
by: =?Utf-8?B?UGF1bCBQaGlsbGlwcw==?= | last post by:
I have read many things about this but I haven't got a clear vision on what to do if anything about this. I have a system that tries to find holes in my web site. One of the things it has found and has been sent to me is an Invalid_Viewstate exception. I will provide the stack trace below. If you read down the stack trace it talks about "Invalid chararcter in a base-64
1
2375
by: =?Utf-8?B?UGF1bCBQaGlsbGlwcw==?= | last post by:
I have read many things about this but I haven't got a clear vision on what to do if anything about this. I have a system that tries to find holes in my web site. One of the things it has found and has been sent to me is an Invalid_Viewstate exception. I will provide the stack trace below. If you read down the stack trace it talks about "Invalid chararcter in a base-64
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10413
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10200
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9021
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7530
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6769
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5422
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4094
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.