473,386 Members | 1,819 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Errors: Failed to load viewstate. & Validation of viewstate MAC failed.

Hello,

I have applications that produce the following error when they have been
open to long without activity. Is there any way to force a re-load of the
page or go to another page if the page has expired instead of getting the
error?

Thanks,
Failed to load viewstate. The control tree into which viewstate is being
loaded must match the control tree that was used to save viewstate during
the previous request. For example, when adding controls dynamically, the
controls added during a post-back must match the type and position of the
controls added during the initial request.
Server Error in '/' Application.
Validation of viewstate MAC failed. If this application is hosted by a Web
Farm or cluster, ensure that <machineKeyconfiguration specifies the same
validationKey and validation algorithm. AutoGenerate cannot be used in a
cluster.
Aug 31 '06 #1
6 2917
KJ
A few preliminary questions: are you hosted on a web farm; if so, do
you have enableViewStateMac set to false in your Web.Config, for
example:

<pages enableViewStateMac="false"/>

sck10 wrote:
Hello,

I have applications that produce the following error when they have been
open to long without activity. Is there any way to force a re-load of the
page or go to another page if the page has expired instead of getting the
error?

Thanks,
Failed to load viewstate. The control tree into which viewstate is being
loaded must match the control tree that was used to save viewstate during
the previous request. For example, when adding controls dynamically, the
controls added during a post-back must match the type and position of the
controls added during the initial request.
Server Error in '/' Application.
Validation of viewstate MAC failed. If this application is hosted by a Web
Farm or cluster, ensure that <machineKeyconfiguration specifies the same
validationKey and validation algorithm. AutoGenerate cannot be used in a
cluster.
Aug 31 '06 #2
Hi KJ,

No, I am not on a web farm...

Thanks, sck10
"KJ" <n_**********@mail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
>A few preliminary questions: are you hosted on a web farm; if so, do
you have enableViewStateMac set to false in your Web.Config, for
example:

<pages enableViewStateMac="false"/>

sck10 wrote:
>Hello,

I have applications that produce the following error when they have been
open to long without activity. Is there any way to force a re-load of
the
page or go to another page if the page has expired instead of getting the
error?

Thanks,
Failed to load viewstate. The control tree into which viewstate is being
loaded must match the control tree that was used to save viewstate during
the previous request. For example, when adding controls dynamically, the
controls added during a post-back must match the type and position of the
controls added during the initial request.
Server Error in '/' Application.
Validation of viewstate MAC failed. If this application is hosted by a
Web
Farm or cluster, ensure that <machineKeyconfiguration specifies the
same
validationKey and validation algorithm. AutoGenerate cannot be used in a
cluster.

Aug 31 '06 #3
KJ
In this case, I don't have a correct answer for you. You could try the
following links:

http://www.andreas-kraus.net/blog/va...te-mac-failed/
http://dotnetjunkies.com/WebLog/thom...06/139890.aspx

sck10 wrote:
Hi KJ,

No, I am not on a web farm...

Thanks, sck10
"KJ" <n_**********@mail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
A few preliminary questions: are you hosted on a web farm; if so, do
you have enableViewStateMac set to false in your Web.Config, for
example:

<pages enableViewStateMac="false"/>

sck10 wrote:
Hello,

I have applications that produce the following error when they have been
open to long without activity. Is there any way to force a re-load of
the
page or go to another page if the page has expired instead of getting the
error?

Thanks,
Failed to load viewstate. The control tree into which viewstate is being
loaded must match the control tree that was used to save viewstate during
the previous request. For example, when adding controls dynamically, the
controls added during a post-back must match the type and position of the
controls added during the initial request.
Server Error in '/' Application.
Validation of viewstate MAC failed. If this application is hosted by a
Web
Farm or cluster, ensure that <machineKeyconfiguration specifies the
same
validationKey and validation algorithm. AutoGenerate cannot be used in a
cluster.
Aug 31 '06 #4
Hello Steve,

From your description, the problem occurs when the page has been idle for
long time. Does it occur when the page is display in short time and be
fresh? For long time idle page, I think the exception is likely due to the
viewstate MAC has been expired and the server runtime can not validate it.
ASP.NET will perform a simple digest on the viewstate and check it later
when page postback, however, this digest is not valid forever, after long
period, it could refresh it. I've also seen some one encountering such
problem when using page cached in google page cache.

For your another question:
================
Is there any way to force a re-load of the
page or go to another page if the page has expired instead of getting the
error?
================

Do you think use client-side script to set a timer and postback/reload the
page after a certain periold workable for you? e.g.

#the following page use script to reload the page after 20 secs
==================
....................
<script type="text/javascript">
function client_onload()
{
window.setTimeout("refresh_page()", 20000);
}

function refresh_page()
{
window.location.href = window.location.href;
}
</script>
</head>
<body onload="client_onload();">
<form id="form1" runat="server" >
<div>
..............
===============

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Sep 1 '06 #5
Thanks KJ, I'll check out the site...
"KJ" <n_**********@mail.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
In this case, I don't have a correct answer for you. You could try the
following links:

http://www.andreas-kraus.net/blog/va...te-mac-failed/
http://dotnetjunkies.com/WebLog/thom...06/139890.aspx

sck10 wrote:
>Hi KJ,

No, I am not on a web farm...

Thanks, sck10
"KJ" <n_**********@mail.comwrote in message
news:11**********************@e3g2000cwe.googlegr oups.com...
>A few preliminary questions: are you hosted on a web farm; if so, do
you have enableViewStateMac set to false in your Web.Config, for
example:

<pages enableViewStateMac="false"/>

sck10 wrote:
Hello,

I have applications that produce the following error when they have
been
open to long without activity. Is there any way to force a re-load of
the
page or go to another page if the page has expired instead of getting
the
error?

Thanks,
Failed to load viewstate. The control tree into which viewstate is
being
loaded must match the control tree that was used to save viewstate
during
the previous request. For example, when adding controls dynamically,
the
controls added during a post-back must match the type and position of
the
controls added during the initial request.
Server Error in '/' Application.
Validation of viewstate MAC failed. If this application is hosted by a
Web
Farm or cluster, ensure that <machineKeyconfiguration specifies the
same
validationKey and validation algorithm. AutoGenerate cannot be used in
a
cluster.

Sep 1 '06 #6
Steven,

Thanks for the timer script. That may be the solution I need...

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:Yi**************@TK2MSFTNGXA01.phx.gbl...
Hello Steve,

From your description, the problem occurs when the page has been idle for
long time. Does it occur when the page is display in short time and be
fresh? For long time idle page, I think the exception is likely due to the
viewstate MAC has been expired and the server runtime can not validate it.
ASP.NET will perform a simple digest on the viewstate and check it later
when page postback, however, this digest is not valid forever, after long
period, it could refresh it. I've also seen some one encountering such
problem when using page cached in google page cache.

For your another question:
================
Is there any way to force a re-load of the
page or go to another page if the page has expired instead of getting the
error?
================

Do you think use client-side script to set a timer and postback/reload the
page after a certain periold workable for you? e.g.

#the following page use script to reload the page after 20 secs
==================
...................
<script type="text/javascript">
function client_onload()
{
window.setTimeout("refresh_page()", 20000);
}

function refresh_page()
{
window.location.href = window.location.href;
}
</script>
</head>
<body onload="client_onload();">
<form id="form1" runat="server" >
<div>
.............
===============

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.


Sep 1 '06 #7

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

Similar topics

9
by: John Kirksey | last post by:
I have a page that uses an in-place editable DataGrid that supports sorting and paging. EnableViewState is turned ON. At the top of the page are several search fields that allow the user to filter...
1
by: Dhruba Bandopadhyay | last post by:
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm....
5
by: russell.lane | last post by:
I'm getting the much-hated "validation of viewstate MAC failed" error. This is on an ASP.Net 2.0 app running in IIS with IE 6+ as the browser. The full error text is: Validation of viewstate...
2
by: sck10 | last post by:
Hello, I have a web page that has a GridView and a FormView, each in its own panel. The GridView shows a list of records in a database. When a row in the GridView is selected the FormView...
6
by: Gibble | last post by:
We have been receiving 100s of this error: ---------- Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKeyconfiguration specifies...
5
by: SpaceMarine | last post by:
hello, when my page attempts a Telerik RadGrid row insert (AJAX enabled) my page throws this exception: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or...
3
by: sck10 | last post by:
Hello, I have a web project (VS 2008 c#). I have a page that opens, but when I try to call an assembly (managed c++) on a submit event, I get the following error on the web server, but not on...
1
by: daveh551 | last post by:
Okay, I've googled this, and come up with several articles, but none of them seem to apply to my site. I have an eCommerce site with a product category tree in the left navigation bar. The tree...
0
by: skozyk | last post by:
I kept getting the following error: "Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.