Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Invalid ViewState Problems

Reply
Thread Tools

Invalid ViewState Problems

 
 
=?Utf-8?B?R2lsZXMgUGFwd29ydGg=?=
Guest
Posts: n/a
 
      06-11-2007
I seem to be getting this error message all of a sudden on one of my web apps:

[HttpException (0x80004005): Unable to validate data.]
System.Web.Configuration.MachineKey.GetDecodedData (Byte[] buf, Byte[]
modifier, Int32 start, Int32 length, Int32& dataLength) +195
System.Web.UI.LosFormatter.Deserialize(String input) +60

[HttpException (0x80004005): 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 back to the same page. 3) The
viewstate for this page might be corrupted.]
System.Web.UI.LosFormatter.Deserialize(String input) +117
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +102

[HttpException (0x80004005): Invalid_Viewstate


And it goes on to explain about the page. On one development machine this
works and then on mine this doesn't. Any ideas why this would suddenly start
happening?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QXJpcyBIb3ViYXZsaXM=?=
Guest
Posts: n/a
 
      06-11-2007
Hi Giles,
There are 2 things you need to make sure of.
1 . If these machines are part of a webfarm make sure all web.config
validationKey,
decryptionKey have the same value across all machines.
2. All objects you place in viewstate are serializable.

Thanks,
Aris

"Giles Papworth" wrote:

> I seem to be getting this error message all of a sudden on one of my web apps:
>
> [HttpException (0x80004005): Unable to validate data.]
> System.Web.Configuration.MachineKey.GetDecodedData (Byte[] buf, Byte[]
> modifier, Int32 start, Int32 length, Int32& dataLength) +195
> System.Web.UI.LosFormatter.Deserialize(String input) +60
>
> [HttpException (0x80004005): 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 back to the same page. 3) The
> viewstate for this page might be corrupted.]
> System.Web.UI.LosFormatter.Deserialize(String input) +117
> System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +102
>
> [HttpException (0x80004005): Invalid_Viewstate
>
>
> And it goes on to explain about the page. On one development machine this
> works and then on mine this doesn't. Any ideas why this would suddenly start
> happening?

 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2lsZXMgUGFwd29ydGg=?=
Guest
Posts: n/a
 
      06-11-2007
Hi Aris,

These machines are definatly not part of a web farm and the objects are
definatly serializable.
I have changed my machine config to make sure that isn't causing the problem
however if i do that, the viewstate problem goes away and another appears.
Strangly enough it is only this one web app. All the others seem to work fine.

"Aris Houbavlis" wrote:

> Hi Giles,
> There are 2 things you need to make sure of.
> 1 . If these machines are part of a webfarm make sure all web.config
> validationKey,
> decryptionKey have the same value across all machines.
> 2. All objects you place in viewstate are serializable.
>
> Thanks,
> Aris
>
> "Giles Papworth" wrote:
>
> > I seem to be getting this error message all of a sudden on one of my web apps:
> >
> > [HttpException (0x80004005): Unable to validate data.]
> > System.Web.Configuration.MachineKey.GetDecodedData (Byte[] buf, Byte[]
> > modifier, Int32 start, Int32 length, Int32& dataLength) +195
> > System.Web.UI.LosFormatter.Deserialize(String input) +60
> >
> > [HttpException (0x80004005): 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 back to the same page. 3) The
> > viewstate for this page might be corrupted.]
> > System.Web.UI.LosFormatter.Deserialize(String input) +117
> > System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +102
> >
> > [HttpException (0x80004005): Invalid_Viewstate
> >
> >
> > And it goes on to explain about the page. On one development machine this
> > works and then on mine this doesn't. Any ideas why this would suddenly start
> > happening?

 
Reply With Quote
 
=?Utf-8?B?R2lsZXMgUGFwd29ydGg=?=
Guest
Posts: n/a
 
      06-12-2007
Also i have now changed my machine key and that seems to have resolved that
problem but now the session seems to be ending everytime i have posted data
to another page.

"Aris Houbavlis" wrote:

> Hi Giles,
> There are 2 things you need to make sure of.
> 1 . If these machines are part of a webfarm make sure all web.config
> validationKey,
> decryptionKey have the same value across all machines.
> 2. All objects you place in viewstate are serializable.
>
> Thanks,
> Aris
>
> "Giles Papworth" wrote:
>
> > I seem to be getting this error message all of a sudden on one of my web apps:
> >
> > [HttpException (0x80004005): Unable to validate data.]
> > System.Web.Configuration.MachineKey.GetDecodedData (Byte[] buf, Byte[]
> > modifier, Int32 start, Int32 length, Int32& dataLength) +195
> > System.Web.UI.LosFormatter.Deserialize(String input) +60
> >
> > [HttpException (0x80004005): 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 back to the same page. 3) The
> > viewstate for this page might be corrupted.]
> > System.Web.UI.LosFormatter.Deserialize(String input) +117
> > System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +102
> >
> > [HttpException (0x80004005): Invalid_Viewstate
> >
> >
> > And it goes on to explain about the page. On one development machine this
> > works and then on mine this doesn't. Any ideas why this would suddenly start
> > happening?

 
Reply With Quote
 
=?Utf-8?B?QXJpcyBIb3ViYXZsaXM=?=
Guest
Posts: n/a
 
      06-12-2007
Hi Giles,
Try adding this in your web.config
<pages buffer="true" enableSessionState="true" enableViewState="true"
enableViewStateMac="false" />

Aris

"Giles Papworth" wrote:

> Also i have now changed my machine key and that seems to have resolved that
> problem but now the session seems to be ending everytime i have posted data
> to another page.
>
> "Aris Houbavlis" wrote:
>
> > Hi Giles,
> > There are 2 things you need to make sure of.
> > 1 . If these machines are part of a webfarm make sure all web.config
> > validationKey,
> > decryptionKey have the same value across all machines.
> > 2. All objects you place in viewstate are serializable.
> >
> > Thanks,
> > Aris
> >
> > "Giles Papworth" wrote:
> >
> > > I seem to be getting this error message all of a sudden on one of my web apps:
> > >
> > > [HttpException (0x80004005): Unable to validate data.]
> > > System.Web.Configuration.MachineKey.GetDecodedData (Byte[] buf, Byte[]
> > > modifier, Int32 start, Int32 length, Int32& dataLength) +195
> > > System.Web.UI.LosFormatter.Deserialize(String input) +60
> > >
> > > [HttpException (0x80004005): 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 back to the same page. 3) The
> > > viewstate for this page might be corrupted.]
> > > System.Web.UI.LosFormatter.Deserialize(String input) +117
> > > System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +102
> > >
> > > [HttpException (0x80004005): Invalid_Viewstate
> > >
> > >
> > > And it goes on to explain about the page. On one development machine this
> > > works and then on mine this doesn't. Any ideas why this would suddenly start
> > > happening?

 
Reply With Quote
 
=?Utf-8?B?R2lsZXMgUGFwd29ydGg=?=
Guest
Posts: n/a
 
      06-12-2007
What section in the web.config does that go in?

"Aris Houbavlis" wrote:

> Hi Giles,
> Try adding this in your web.config
> <pages buffer="true" enableSessionState="true" enableViewState="true"
> enableViewStateMac="false" />
>
> Aris
>
> "Giles Papworth" wrote:
>
> > Also i have now changed my machine key and that seems to have resolved that
> > problem but now the session seems to be ending everytime i have posted data
> > to another page.
> >
> > "Aris Houbavlis" wrote:
> >
> > > Hi Giles,
> > > There are 2 things you need to make sure of.
> > > 1 . If these machines are part of a webfarm make sure all web.config
> > > validationKey,
> > > decryptionKey have the same value across all machines.
> > > 2. All objects you place in viewstate are serializable.
> > >
> > > Thanks,
> > > Aris
> > >
> > > "Giles Papworth" wrote:
> > >
> > > > I seem to be getting this error message all of a sudden on one of my web apps:
> > > >
> > > > [HttpException (0x80004005): Unable to validate data.]
> > > > System.Web.Configuration.MachineKey.GetDecodedData (Byte[] buf, Byte[]
> > > > modifier, Int32 start, Int32 length, Int32& dataLength) +195
> > > > System.Web.UI.LosFormatter.Deserialize(String input) +60
> > > >
> > > > [HttpException (0x80004005): 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 back to the same page. 3) The
> > > > viewstate for this page might be corrupted.]
> > > > System.Web.UI.LosFormatter.Deserialize(String input) +117
> > > > System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +102
> > > >
> > > > [HttpException (0x80004005): Invalid_Viewstate
> > > >
> > > >
> > > > And it goes on to explain about the page. On one development machine this
> > > > works and then on mine this doesn't. Any ideas why this would suddenly start
> > > > happening?

 
Reply With Quote
 
=?Utf-8?B?QXJpcyBIb3ViYXZsaXM=?=
Guest
Posts: n/a
 
      06-12-2007
<configuration>
<system.web>
<pages buffer="true" ...
...
...
...
...
</system.web>
</configuration>


"Giles Papworth" wrote:

> What section in the web.config does that go in?
>
> "Aris Houbavlis" wrote:
>
> > Hi Giles,
> > Try adding this in your web.config
> > <pages buffer="true" enableSessionState="true" enableViewState="true"
> > enableViewStateMac="false" />
> >
> > Aris
> >
> > "Giles Papworth" wrote:
> >
> > > Also i have now changed my machine key and that seems to have resolved that
> > > problem but now the session seems to be ending everytime i have posted data
> > > to another page.
> > >
> > > "Aris Houbavlis" wrote:
> > >
> > > > Hi Giles,
> > > > There are 2 things you need to make sure of.
> > > > 1 . If these machines are part of a webfarm make sure all web.config
> > > > validationKey,
> > > > decryptionKey have the same value across all machines.
> > > > 2. All objects you place in viewstate are serializable.
> > > >
> > > > Thanks,
> > > > Aris
> > > >
> > > > "Giles Papworth" wrote:
> > > >
> > > > > I seem to be getting this error message all of a sudden on one of my web apps:
> > > > >
> > > > > [HttpException (0x80004005): Unable to validate data.]
> > > > > System.Web.Configuration.MachineKey.GetDecodedData (Byte[] buf, Byte[]
> > > > > modifier, Int32 start, Int32 length, Int32& dataLength) +195
> > > > > System.Web.UI.LosFormatter.Deserialize(String input) +60
> > > > >
> > > > > [HttpException (0x80004005): 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 back to the same page. 3) The
> > > > > viewstate for this page might be corrupted.]
> > > > > System.Web.UI.LosFormatter.Deserialize(String input) +117
> > > > > System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +102
> > > > >
> > > > > [HttpException (0x80004005): Invalid_Viewstate
> > > > >
> > > > >
> > > > > And it goes on to explain about the page. On one development machine this
> > > > > works and then on mine this doesn't. Any ideas why this would suddenly start
> > > > > happening?

 
Reply With Quote
 
=?Utf-8?B?R2lsZXMgUGFwd29ydGg=?=
Guest
Posts: n/a
 
      06-12-2007
Thanks for that but it seems to have made no difference.

"Aris Houbavlis" wrote:

> <configuration>
> <system.web>
> <pages buffer="true" ...
> ...
> ...
> ...
> ...
> </system.web>
> </configuration>
>
>
> "Giles Papworth" wrote:
>
> > What section in the web.config does that go in?
> >
> > "Aris Houbavlis" wrote:
> >
> > > Hi Giles,
> > > Try adding this in your web.config
> > > <pages buffer="true" enableSessionState="true" enableViewState="true"
> > > enableViewStateMac="false" />
> > >
> > > Aris
> > >
> > > "Giles Papworth" wrote:
> > >
> > > > Also i have now changed my machine key and that seems to have resolved that
> > > > problem but now the session seems to be ending everytime i have posted data
> > > > to another page.
> > > >
> > > > "Aris Houbavlis" wrote:
> > > >
> > > > > Hi Giles,
> > > > > There are 2 things you need to make sure of.
> > > > > 1 . If these machines are part of a webfarm make sure all web.config
> > > > > validationKey,
> > > > > decryptionKey have the same value across all machines.
> > > > > 2. All objects you place in viewstate are serializable.
> > > > >
> > > > > Thanks,
> > > > > Aris
> > > > >
> > > > > "Giles Papworth" wrote:
> > > > >
> > > > > > I seem to be getting this error message all of a sudden on one of my web apps:
> > > > > >
> > > > > > [HttpException (0x80004005): Unable to validate data.]
> > > > > > System.Web.Configuration.MachineKey.GetDecodedData (Byte[] buf, Byte[]
> > > > > > modifier, Int32 start, Int32 length, Int32& dataLength) +195
> > > > > > System.Web.UI.LosFormatter.Deserialize(String input) +60
> > > > > >
> > > > > > [HttpException (0x80004005): 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 back to the same page. 3) The
> > > > > > viewstate for this page might be corrupted.]
> > > > > > System.Web.UI.LosFormatter.Deserialize(String input) +117
> > > > > > System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +102
> > > > > >
> > > > > > [HttpException (0x80004005): Invalid_Viewstate
> > > > > >
> > > > > >
> > > > > > And it goes on to explain about the page. On one development machine this
> > > > > > works and then on mine this doesn't. Any ideas why this would suddenly start
> > > > > > happening?

 
Reply With Quote
 
=?Utf-8?B?QXJpcyBIb3ViYXZsaXM=?=
Guest
Posts: n/a
 
      06-12-2007
what state server setting do u have?
InProc,
SqlServer,
StateServer,
Off (Disables session state)

<system.web>
<sessionState mode="StateServer"
stateConnectionString="tcpip=SampleStateServer:424 24"
cookieless="false"
timeout="20"/>
....
....
....
</system.web

"Giles Papworth" wrote:

> Thanks for that but it seems to have made no difference.
>
> "Aris Houbavlis" wrote:
>
> > <configuration>
> > <system.web>
> > <pages buffer="true" ...
> > ...
> > ...
> > ...
> > ...
> > </system.web>
> > </configuration>
> >
> >
> > "Giles Papworth" wrote:
> >
> > > What section in the web.config does that go in?
> > >
> > > "Aris Houbavlis" wrote:
> > >
> > > > Hi Giles,
> > > > Try adding this in your web.config
> > > > <pages buffer="true" enableSessionState="true" enableViewState="true"
> > > > enableViewStateMac="false" />
> > > >
> > > > Aris
> > > >
> > > > "Giles Papworth" wrote:
> > > >
> > > > > Also i have now changed my machine key and that seems to have resolved that
> > > > > problem but now the session seems to be ending everytime i have posted data
> > > > > to another page.
> > > > >
> > > > > "Aris Houbavlis" wrote:
> > > > >
> > > > > > Hi Giles,
> > > > > > There are 2 things you need to make sure of.
> > > > > > 1 . If these machines are part of a webfarm make sure all web.config
> > > > > > validationKey,
> > > > > > decryptionKey have the same value across all machines.
> > > > > > 2. All objects you place in viewstate are serializable.
> > > > > >
> > > > > > Thanks,
> > > > > > Aris
> > > > > >
> > > > > > "Giles Papworth" wrote:
> > > > > >
> > > > > > > I seem to be getting this error message all of a sudden on one of my web apps:
> > > > > > >
> > > > > > > [HttpException (0x80004005): Unable to validate data.]
> > > > > > > System.Web.Configuration.MachineKey.GetDecodedData (Byte[] buf, Byte[]
> > > > > > > modifier, Int32 start, Int32 length, Int32& dataLength) +195
> > > > > > > System.Web.UI.LosFormatter.Deserialize(String input) +60
> > > > > > >
> > > > > > > [HttpException (0x80004005): 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 back to the same page. 3) The
> > > > > > > viewstate for this page might be corrupted.]
> > > > > > > System.Web.UI.LosFormatter.Deserialize(String input) +117
> > > > > > > System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +102
> > > > > > >
> > > > > > > [HttpException (0x80004005): Invalid_Viewstate
> > > > > > >
> > > > > > >
> > > > > > > And it goes on to explain about the page. On one development machine this
> > > > > > > works and then on mine this doesn't. Any ideas why this would suddenly start
> > > > > > > happening?

 
Reply With Quote
 
=?Utf-8?B?R2lsZXMgUGFwd29ydGg=?=
Guest
Posts: n/a
 
      06-12-2007
<sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false" timeout="20"/>

"Aris Houbavlis" wrote:

> what state server setting do u have?
> InProc,
> SqlServer,
> StateServer,
> Off (Disables session state)
>
> <system.web>
> <sessionState mode="StateServer"
> stateConnectionString="tcpip=SampleStateServer:424 24"
> cookieless="false"
> timeout="20"/>
> ....
> ....
> ....
> </system.web
>
> "Giles Papworth" wrote:
>
> > Thanks for that but it seems to have made no difference.
> >
> > "Aris Houbavlis" wrote:
> >
> > > <configuration>
> > > <system.web>
> > > <pages buffer="true" ...
> > > ...
> > > ...
> > > ...
> > > ...
> > > </system.web>
> > > </configuration>
> > >
> > >
> > > "Giles Papworth" wrote:
> > >
> > > > What section in the web.config does that go in?
> > > >
> > > > "Aris Houbavlis" wrote:
> > > >
> > > > > Hi Giles,
> > > > > Try adding this in your web.config
> > > > > <pages buffer="true" enableSessionState="true" enableViewState="true"
> > > > > enableViewStateMac="false" />
> > > > >
> > > > > Aris
> > > > >
> > > > > "Giles Papworth" wrote:
> > > > >
> > > > > > Also i have now changed my machine key and that seems to have resolved that
> > > > > > problem but now the session seems to be ending everytime i have posted data
> > > > > > to another page.
> > > > > >
> > > > > > "Aris Houbavlis" wrote:
> > > > > >
> > > > > > > Hi Giles,
> > > > > > > There are 2 things you need to make sure of.
> > > > > > > 1 . If these machines are part of a webfarm make sure all web.config
> > > > > > > validationKey,
> > > > > > > decryptionKey have the same value across all machines.
> > > > > > > 2. All objects you place in viewstate are serializable.
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Aris
> > > > > > >
> > > > > > > "Giles Papworth" wrote:
> > > > > > >
> > > > > > > > I seem to be getting this error message all of a sudden on one of my web apps:
> > > > > > > >
> > > > > > > > [HttpException (0x80004005): Unable to validate data.]
> > > > > > > > System.Web.Configuration.MachineKey.GetDecodedData (Byte[] buf, Byte[]
> > > > > > > > modifier, Int32 start, Int32 length, Int32& dataLength) +195
> > > > > > > > System.Web.UI.LosFormatter.Deserialize(String input) +60
> > > > > > > >
> > > > > > > > [HttpException (0x80004005): 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 back to the same page. 3) The
> > > > > > > > viewstate for this page might be corrupted.]
> > > > > > > > System.Web.UI.LosFormatter.Deserialize(String input) +117
> > > > > > > > System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +102
> > > > > > > >
> > > > > > > > [HttpException (0x80004005): Invalid_Viewstate
> > > > > > > >
> > > > > > > >
> > > > > > > > And it goes on to explain about the page. On one development machine this
> > > > > > > > works and then on mine this doesn't. Any ideas why this would suddenly start
> > > > > > > > happening?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with ViewState: "function 'ViewState.get_Item' evaluated and returned null" Steph ASP .Net 2 05-11-2011 02:35 PM
How do fix: "Wrong number of arguments" / "invalid propert assignment"/ "Invalid argument" Java Guy Java 1 10-15-2006 08:31 PM
Invalid URI: There is an invalid sequence in the string. Error!! Patrick.O.Ige ASP .Net 1 07-02-2006 11:21 AM
Loading usercontrols, viewstate problem, slighly different from all others "viewstate uc problems" please help... ujjc001 ASP .Net 0 07-27-2005 01:52 PM
invalid@invalid.org Hank Sniadoch Computer Information 1 08-20-2004 11:24 AM



Advertisments