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


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

Validation of viewstate MAC failed

Posted By:      Posted Date: October 15, 2010    Points: 0   Category :ASP.Net
 

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.




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

"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 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?

 


List data validation failed error checking in dockument and uploading to library.

  
If I upload a document to the "vanilla" Document Library at the root site (I have not created sub sites yet, we are in the testing phase), the document does get uploaded but the following error appears: Error List data validation failed.   Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: 0928c39a-f2d7-4ce6-8057-62cc01c6a951 Date and Time: 6/16/2010 5:27:58 PM Go back to site -------------------------------------------------------------------------- The doc has uploaded but is automatically checked out to me I am logged on as the ADMINISTRATOR Account Now if I try and discard the check out, it will fail as there is no original checked in version. If I try and click Check in, then the same error appears Help

Token-based server access validation failed with an infrastructure error

  
Hi We have a new Win 2008 Enterprise x64 server running SQL 2008When we try to connect to the server using Windows Authentication, from a user account which is a domain administrator, we get the following message:"Token-based server access validation failed with an infrastructure error"What needs to be configured here for this to work ?ThanksBruce

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

Login failed for user: Reason:Token-based server access validation failed with an infrastructure err

  

Hi,

I have installed a named instance of SQL Server 2008 R2 Enterprise 64 bit on Windows Server 2008 R2 Enterprise 64 bit. The os is running as a VM ware virtual machine.

I have created an AD security group for database engine sys admins on that machine. I added my user to that group.So for example;

domainname\machinename_SQL_DBE_SysADmins is a user with SysAdmin server role permissions. User domainname\MichaelEFF is a member of this group.

When I log onto the machine as this user and run the management studio with run as administrator I cannot log into the database engine. The log shows the error:

Login failed for user: Reason:Token-based server access validation failed with an infrastructure error

I've read many posts where the MVP says that the UAC is not passing the group membership. Is this the case? If so then how will role based access ever be possible with windows authentication? How can this be resolved?

 

Thanks!

Michael


Login failed for user:Token-based server access validation failed with an infrastructure error

  
 

I would appreciate help with the following issue:

 

I have created a local group in our SQL 2008 server and added two Windows user accounts "DOMAIN\UserName"  I  then added the local group to the database and granted read only access.

 

The users are trying to link tables using MS Access using and ODBC connection and getting the following error.

Users are not system administrators.

 

Date                      6/30/2010 1:01:54 PM

Log                         SQ

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)
			{
		

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

  

 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&

SSIS pakage fails "component "OLE DB Destination" (67)" failed validation and returned validation st

  

I have a package that is executed within a SQL job. The package has been running successfully since quite some time now. Recently I had to rebuild the DB schema (as I was testing the deployment of my application). The package ran successfully once after I re-built the underlying DB  schema.  But it  failed with the following message the next day but has been running successfully automagically after it had failed. 

Note : The schema before and after the rebuild operation has not changed.

The error message thrown on the day it failed is as below (loginname/tablename/Task name are scrubbed) :

Message
Executed as user: <User Name>. Microsoft (R) SQL Server Execute Package Utility  Version 10.0.2531.0 for 64-bit  Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    Started:  7:00:00 AM  Error: 2010-11-13 07:00:10.03     Code: 0xC0202009     Source: <Task Name> OLE DB Destination [67]     Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.  An OLE DB record is available.  Source: "Microsoft SQL Server Native Client 10.0"  Hresult: 0x80004005  Description: "Connection is busy with

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. 

 


Unexpected "Microsoft.SharePoint.SPListDataValidationException: List data validation failed."

  

Steps to replicate (I suspect it can be replicated with any list, not just a survey):

1. Create a survey
2. Go to Survey Settings / Validation Settings, enter a formula and a user message.
3. Respond to a survey. 
3.1. If a formula validation succeeds, a new survey response is created.
3.2. If a formula validation fails, I expect to see a user message created in step #2 above. Instead, I see an exception:

 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: Microsoft.SharePoint.SPListDataValidationException: List data validation failed.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

<

Server side validation of Fileupload control not working

  
 

 


I've tried this method in my code behind to try and validate that the Fileupload control has a file or not. I get the error message the the event "Server Validate" cannot be found. Can anyone tell why? Thanks.


Public Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate
       

' Get file name

        Dim uploadAvatar As FileUpload = DirectCast(AdvertisementForm.FindControl("uploadAvatar"), FileUpload)

        Dim UploadFileName As String = uploadAvatar.PostedFile.FileName

        If UploadFileName = "" Then
            ' There is no file selected
            args.IsValid = False
        Else
            Dim Extension As String = UploadFileName.Substring(UploadFileName.L

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