Hai Guys,
I'm Mathiyalgan... Working as asp.net developer in a small software concern . I've seen ur Article in the website...4guysfromrolla... It is quite nice... I hav used master pages in my application... and i want to use some validation controls in my content pages..
I 've tried but it causes an Error like
Server Error in '/Winfairr' 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 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:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your application:
<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.
Stack Trace:
[HttpException (0x80004005): Unable to validate data.]
System.Web.Configuration.MachineKeySection.GetDeco dedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +398
System.Web.UI.ObjectStateFormatter.Deserialize(Str ing inputString) +294
[ViewStateException: Invalid viewstate.
Client IP: 127.0.0.1
Port:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)
ViewState: QobM+D89GzVl6Jp+4tiPdperHNthYn4LEQ+Snb8ThHwHaoIb0A sBRTVv08HwBlHxkDtsddltdJAsIXx4IUsSg01fbbkZKaqMLPFC DXMqoeGSqmnNr5puKJOzU6uEZT2XZr8g8lLz+gHWDI+RuS7mw+ rwWuiSbYOB3e8XU0/Rl9fqyO6v0wF+LAsAl5RDD26BnyGBjLVouYBKzdGUazxO6DjEZ h1tNXsxgWyxUFqgkZe0NleY/+A37Fjn+jidnO1ajv2a1gpxZ07tEfoQ4VvfPaNwUgnvBvNPUHU ZiZT/J0GgOoTDMDGKq5HI/kJ1rg++EKblUCsxb62+G/ldw9l9V6CFCNOPpVnD9vGhOMyQaYMuwjlWvS30OW1EDow71GND Ps5MFQ/Mg/Vpw9NfB4GAv3g2N7F/Exmwg6bObuSZruO2isWQRDs4v8yDFQP0SAETEO5LFYzrm/QalUJAg2VBFlNws5vuxVxotpWkNvO0cr4=
Referer: http://localhost:1039/Winfairr/WorkDetails.aspx
Path: /Winfairr/HomePage.aspx]
[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(Except ion inner, String persistedState, String errorPageMessage, Boolean macValidationError) +171
System.Web.UI.ViewStateException.ThrowMacValidatio nError(Exception inner, String persistedState) +37
System.Web.UI.ObjectStateFormatter.Deserialize(Str ing inputString) +329
System.Web.UI.ObjectStateFormatter.System.Web.UI.I StateFormatter.Deserialize(String serializedState) +30
System.Web.UI.Util.DeserializeWithAssert(IStateFor matter formatter, String serializedState) +52
System.Web.UI.HiddenFieldPageStatePersister.Load() +256
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium() +137
System.Web.UI.Page.LoadAllState() +102
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5916
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +188
System.Web.UI.Page.ProcessRequest() +112
System.Web.UI.Page.ProcessRequestWithNoAssert(Http Context context) +37
System.Web.UI.Page.ProcessRequest(HttpContext context) +135
ASP.homepage_aspx.ProcessRequest(HttpContext context) +29
System.Web.CallHandlerExecutionStep.System.Web.Htt pApplication.IExecutionStep.Execute() +401
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +117
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Will u please clarify how can i remove this error Sometime it causes Enable Event Validation Error ... How can i overcome these two Errors...
Meet u again
Mathiyalagan..S..