.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
ASPEvil
Jean Paul
satyapriyanayak
Ashutosh Jha
SP
Post New Web Links

Viewstate verification failed. Reason: The viewstate supplied failed integrity check.

Posted By:      Posted Date: November 16, 2010    Points: 0   Category :ASP.Net
 

 Hi,

I'm getting the following error in my event log appears many times each hour,  if somebody could shed some light it would be very nice...  Also I am running server 2008 web server,  this is NOT a webfarm.

 

- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">

- <System>

<Provider Name="ASP.NET 4.0.30319.0" />

<EventID Qualifiers="16384">1316</EventID>

<Level>4</Level>

<Task>3</Task>

<Keywords>0x80000000000000</Keywords>

<TimeCreated SystemTime="2010-11-15T19:58:53.000000000Z" />

<EventRecordID>269048</EventRecordID>

<Channel>Application</Channel>

<Computer>MYCOMPUTER</Computer>

<Security />

</System>

- <EventData>

<Data>4009</Data>

<Data>Viewstate verification failed. Reason: The viewstate supplied failed integrity check.</Data>

<Data>11/15/2010 2:58:53 PM</Data>

<Data>11/15/2010 7:58:53 PM</Data>

<Data>c90bc32f744a4478bb63271bd76884a4</Data>

<Data>20406</Data>

<Data&


View Complete Post


More Related Resource Links

Validation of viewstate MAC failed

  
Hi Experts,I have received an error "Validation of viewstate MAC failed".I am hosting the web site on my own server, so there is nothing like a "Web Farm or cluster". Can you please advise what could be the problem with this error.I only get this error if the page is left inactive for more then 20 minutes and it throws the exception, so users have log-off and login to continue working fine.See below full error details. Server Error in '/datacapv2' Application. 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. AutoGenerate cannot be used in a cluster. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: 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. AutoGenerate cannot be used in a cluster. Source Error: The source code that generated this unhandled exceptio

Gridview RowCancellingEdit Failed to Load ViewState

  

The subject title should say it all, and I'm not sure what I've done to cause the problem.  Getting the GridView into editing doesn't pose a problem, but getting it back to read only does.

protected void ExceptionsGridView_RowEditing(object sender, GridViewEditEventArgs e)
    {
        string TXTCLIENT = ClientDropDownList.SelectedValue;
        string TXTPROV = DoctorDropDownList.SelectedValue;
        decimal TXTYEAR = Convert.ToDecimal(Calendar1.SelectedDate.Year.ToString());
        decimal TXTMMDD = Convert.ToDecimal(String.Concat(Calendar1.SelectedDate.Month.ToString().PadLeft(2, '0'), Calendar1.SelectedDate.Day.ToString().PadLeft(2, '0')));
        ExceptionsGridView.DataSource = schdExceptions(TXTCLIENT, TXTPROV, TXTYEAR, TXTMMDD);
        
        ExceptionsGridView.EditIndex = e.NewEditIndex;

        ExceptionsGridView.DataBind();
        ExceptionsGridView.EditIndex = -1;
       
    }

    protected void ExceptionsGridView_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
    {
        string TXTCLIENT = ClientDropDownList.SelectedValue;
        string TXTPROV = DoctorDropDownList.SelectedValue;
        decimal TXTYEAR = Convert.ToDecimal(Calendar1.SelectedDate.Year.ToString());
        decimal TXTMMDD = Convert.ToDecimal(String.Concat(Calendar1.SelectedDate.Month.ToSt

Failed to load viewstate. The control tree into which viewstate is being loaded must match the contr

  

Now here is the weird thing. First i am running it locally on the built in vs2008 web server.

I load my control in fine, do a postback from a linkbutton, locally on my machine it all works fine, no issue.

However when it goes onto my host, it falls over with the message:

 

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.

 

Now i also load controls dynamically and use postbacks and things in the admin area of the site...and that works fine, however my front end just keeps failing? See the code behing below:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Reflection;

namespace DJSWebCMS.Web
{
	public partial class Index : System.Web.UI.Page
	{

		private Data.Repositories.RepoClientPage repo = new DJSWebCMS.Data.Repositories.RepoClientPage(Helpers.AppSettings.DatabaseConnectionString);

		public Data.DataObjects.PageDisplay DisplayPage
		{
			get;
			set;
		}

		protected void Page_Load(object sender, EventArgs e)
		{
			if (String.IsNullOrEmpty(Helpers.Request.Path) && Helpers.Request.ID <= 0)
			{
		

"Validation of viewstate MAC failed."

  

Error message

------------------------

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. AutoGenerate cannot be used in a cluster.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: 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. AutoGenerate cannot be used in a cluster.


Conditions

------------------------


- We are not on a web-farm or cluster.

- The web.config file of this ASP.NET program is:

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
	<system.web>
    <compil

Validation of viewstate MAC failed

  

Hello Guys we have a GPS website which is accesed all around the globe.Customers are complaining that when they keep the website running for longer periods and click the refresh button this ViewState MAC failed error appears on their page.All they had to do again is to relogin to website to keep track of their vessels .

The production webserver is not a WEBFARM or CLUSTER.

Some Important points:

 1.We have auto-update set to 15 mins for updating the map on the webpage for vessel positions by connecting to the database and weather data.

2.They can also use refresh button to update the vessel positions and weather data on the map.

so when the customer keeps the website running for longer periods at some moment it stops updating itself(I think it looses database connection) and when customer sees it and click the refresh button the ViewStateMAC validation error occurs.

I have gone through forums and have got some multiple solutions to apply but which is the correct one

1.Extending Application pool recycling periods.

2.Set EnableViewStateMac = false(But I can do this as i will have to compromise on security which is not right)

3.EnableViewStateEncryption=false...........

4.Machine key algorithm.


Validation of viewstate MAC failed Error after Uploading to Web Server

  

I'm trying to figure out this error but I can't point out what's exactly causing this.

Here is what's happening.

User loggs in for a few hours and gets "Validation of viewstate MAC failed" Error after post back.

I have set timeout in Web.config as follow.

<authentication mode="Forms">
            <forms timeout="540" slidingExpiration="true" loginUrl="~/maintain/login.aspx" />
</authentication>


in IIS I have set

ApplicationPool - Idle Time-out 60min

Sesstion State - Cookei Settings Mode: User Cookies, Time-out: 540min


And I'm using this ifame to prevent Idle

http://wiki.asp.net/page.aspx/1086/keep-session-alive/


Emplyee logges in for 8 hours and having this issue a few time a day...


Do you know what else I should look?

I don't know why session expires.


Thank you for your help

Emplyee





Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure t

  
  • I am new to asp.net etc.

I have developed a website that has began to act unusually. I get the following error below.

 

 

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. AutoGenerate cannot be used in a cluster.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: 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. AutoGenerate cannot be used in a cluster.

Source Error:

 

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

 &nbs

url rewriting causing Validation of viewstate MAC failed

  

Hi,

    Has anyone encountered while using Context.RewriteUrl in global.asax causes this error: 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. AutoGenerate cannot be used in a cluster ?

   Here is the scenario, let's say I have a url http://mysite.com/admin/login.aspx instead typing the whole url in address, user can type either http://mysite.com/admin/ or http://mysite.com/admin  which all end up at http://mysite.com/admin/login.aspx. When a user type http://mysite.com/admin and entered correct login info, and press login button it gets the error above. How can I resolve this? Tried setting EnableValidateRequest to false and EnableViewstateMac to false also even I do not want to use this approach and still does not work.

   


Validation of Viewstate MAC Failed -- when session out.

  

Hi all,

I have an issue that has been bothering me for weeks now without a possibility of fixing it.


I have an ASP.NET 3.5 application developed locally which uses Session variables to hold the user login flag and similar pieces of data. Once I had the application moved to a shared hosting environment [GoDaddy], I started experiencing some weird behaviour. Let me explain the process first:


  1. Every page within the application [in the Page_Load event] checks whether the user is logged in or not. If not, it redirects to the login page.
  2. When I forcefully logout [using a procedure that clears the session variables] all is fine.
  3. However, when I leave the page open for more than 30 minutes, and I let the session variables get destroyed by themselves, any action [PostBack] now on that page, issues the 'Validation of ViewState MAC Failed' error.


Now, I had tried to disable EventViewStateValidation both on a local and global level but it doesn't help.


Any suggestions?

 


Failed to load viewstate.

  

Hi.

I had problems with my custom field generator. If I put this line of code

GridView1.ColumnsGenerator = new FieldGenerator(table, true);

in page_init event, I get no errors, but event GenerateFields never fires.

Then I found answer on this forum, that I have to move this line of code to Page_Load event, but now I ger this error, when I am selecting rows in gridview.

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. 

 


System.Data.SqlClient.SqlException: Login failed for user . Reason: The account is disable

  

Hi All,

Thank you for advance.

I created a widows service for mail schedule with c#.net and sql server 2005 and it is working fine for past one year.

now sometimes i am getting the "System.Data.SqlClient.SqlException: Login failed for user '<UserName>'. Reason: The account is disabled." error.

then i restarted the windows service manually and working.

what is the problem in my sql server connection and how to fix that issue?


MessageSecurityException "Identity check failed for outgoing message" when using custom endpointaddr

  
Hi! I am currently developing a WCF service which will use ASP.NET Membership and RoleProvider as authentication/authorization. I followed the description in on this page http://msdn.microsoft.com/en-us/library/ff647294.aspx to do this, and everything works as expected when I try add a reference to my development service and uses that without any interaction. But, I want to be able to override the enpoint address in code since the server may be placed on other servers, but when I do this in my code (with the same enpointAddress stated in the client wcf file for testing purpose) I get a MessageSecurityException with this information: "Identity check failed for outgoing message. The expected DNS identity of the remote endpoint was 'localhost' but the remote endpoint provided DNS claim 'MyCert'. If this is a legitimate remote endpoint, you can fix the problem by explicitly specifying DNS identity 'MyCert' as the Identity property of EndpointAddress when creating channel proxy." I have search the net for information about this, and found that the only thing I had to do was to add a <dns value="MyCert" /> to my client wcf configuration, and everything should work. But it doesn't, I still get the same error. My server behavior configuration looks like this: <serviceCredentials> <serviceCertificate findValue="CN=MyCert" />

A call to SSPI failed: The target principal name is incorrect - How to ignore this Security Check

  
I find that I am getting this error since I am using the netTCPBinding. I don't get this exception when the client and server are on the same machine, but when they are on different machines, this exception occurs. If I set the identity on the end point as mentioned in the article: http://blogs.msdn.com/b/drnick/archive/2007/11/08/setting-a-user-principal-on-the-endpoint.aspx it is working fine.   So my question is , should the service end point always have an identity when using netTcpBinging? I tried setting Security.Mode = None and still I got this identity exception. is there any way through which I can ask the service to ignore the SSPI details and accept client request?   Thanks!

Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential cau

  
Attempting to upgrade from SQL 2005 EE to SQL 2008 EE on Vmware ESX 3.5 virtual server. below is info from Detail.txt related to successful install with failures... 2010-09-02 13:50:46 Slp: Sco: Attempting to check if file 'D:\Data\MSSQL.1\MSSQL\LOG\ERRORLOG' exists 2010-09-02 13:50:46 Slp: Sco: Returning security descriptor O:BAG:SYD:AI(A;ID;FA;;;S-1-5-21-3788118842-658835432-3441893140-1006)(A;ID;FA;;;S-1-5-21-3788118842-658835432-3441893140-1007)(A;ID;FA;;;BA)(A;ID;FA;;;SY)S:AI(AU;IDFA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD) 2010-09-02 13:50:46 Slp: Configuration action failed for feature SQL_Engine_Core_Inst during timing ConfigRC and scenario ConfigRC. 2010-09-02 13:50:46 Slp: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes. 2010-09-02 13:50:46 Slp: Configuration action failed for feature SQL_Engine_Core_Inst during timing ConfigRC and scenario ConfigRC. 2010-09-02 13:50:46 Slp: Microsoft.SqlServer.Configuration.SqlEngine.SqlEngineConfigException: Wait on the Database Engine recovery handle failed. Check the SQL Server error log for potential causes. 2010-09-02 13:50:46 Slp:    at Microsoft.SqlServer.Configuration.SqlEngine.SqlServerServiceBase.WaitSqlServerStart(Process processSql) 2010-09-02 13:50:46 Slp:    at Microsoft.SqlServer.Configuration.SqlEngine.SqlServerServiceSCM.StartSqlServer(St
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend