Below error occur while deploying on server.while it work on local network .

Server Error in '/' 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: 


[No relevant source lines]
 

Source File: c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c8f1f6f4\46f7b6b4\App_Web_elg_mqby.4.cs    Line: 0 

Stack Trace: 


[HttpException (0x80004005): Unable to validate data.]
   System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +289
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +140

[ViewStateException: Invalid viewstate. 
	Client IP: 117.195.6.92
	Port: 50207
	User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)
	ViewState: /wEPDwULLTEyNjkwMDQ0MjkPZBYCZg9kFgQCAQ9kFgICBA8WAh4EaHJlZgVJL0FwcF9UaGVtZXMvRGVmYXVsdC9jc3MuYXhkP2Q9JTdlJTJmQXBwX1RoZW1lcyUyZkRlZmF1bHQlMmZTdHlsZVNoZWV0LmNzc2QCAw9kFgYCBw8PFgIeBFRleHQFBUxvZ2luZGQCJw8PFgIfAQUFR3Vlc3RkZAIpD2QWBgIBD2QWAmYPZBYCAgEPDxYEHglCYWNrQ29sb3IJatn//x4EXyFTQgIIZBYCAgEPDxYEHglGb3JlQ29sb3IJmwu3/x8DAgRkZAIHD2QWEgIED2QWAgICD2QWAgIBDxAPFgYeDURhdGFUZXh0RmllbGQFB0N1bHR1cmUeDkRhdGFWYWx1ZUZpZWxkBQlDdWx0dXJlSWQeC18hRGF0YUJvdW5kZ2QPFgYCAQICAgMCBAIFAgYWBhAFBURlbGhpBQExZxAFB0hhcnlhbmEFATJnEAUJUmFqYXN0aGFuBQEzZxAFDVV0dGFyIFByYWRlc2gFATRnEAUGUHVuamFiBQE1ZxAFBU90aGVyBQE2Z2RkAgUPZBYCAgIPZBYCAgEPEA8WBh8FBQVHb3RyYR8GBQdHb3RyYUlkHwdnZA8WEwIBAgICAwIEAgUCBgIHAggCCQIKAgsCDAINAg4CDwIQAhECEgITFhMQBQRHYXJnBQExZxAFBUdveWFsBQEyZxAFBkJhbnNhbAUBM2cQBQZLYW5zYWwFATRnEAUHU2luZ2hhbAUBNWcQBQZNYW5nYWwFATZnEAUGSmluZGFsBQE3ZxAFBlBpbmdhbAUBOGcQBQ...]

[HttpException (0x80004005): 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.]
   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106
   System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) +14
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +242
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4
   System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37
   System.Web.UI.HiddenFieldPageStatePersister.Load() +207
   System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +105
   OboutInc.oboutAJAXPage.LoadPageStateFromPersistenceMedium() in D:\LiveProjects\AgasenPariwarFinalWithSession_7July\AgrasenPariwar\AjaxControls\obout_AJAXPage\OboutInc\oboutAJAXPage.cs:357
   System.Web.UI.Page.LoadAllState() +43
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
   System.Web.UI.Page.ProcessRequest() +80
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49
   ASP.web_addeditpersonalbiodata_aspx.ProcessRequest(HttpContext context) in c:\windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c8f1f6f4\46f7b6b4\App_Web_elg_mqby.4.cs:0
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

to resolve this issue i have added below line in web.config file <pages enableViewStateMac="false"> then issue resolve but session issue occure.Session terminte in few second.

can anyone help me please.


Thanks,
Gayatri Uttarwar

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.