Hai Guys,
I'm Mathiyalgan... Working as asp.net developer in a small software concern . I've seen ur Article in the website...4guys fromrolla... 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.Http Exception: 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:
<configuratio n>
<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.Conf iguration.Machi neKeySection.Ge tDecodedData(By te[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +398
System.Web.UI.O bjectStateForma tter.Deserializ e(String inputString) +294
[ViewStateExcept ion: 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 +4tiPdperHNthYn 4LEQ+Snb8ThHwHa oIb0AsBRTVv08Hw BlHxkDtsddltdJA sIXx4IUsSg01fbb kZKaqMLPFCDXMqo eGSqmnNr5puKJOz U6uEZT2XZr8g8lL z+gHWDI+RuS7mw+ rwWuiSbYOB3e8XU 0/Rl9fqyO6v0wF+LA sAl5RDD26BnyGBj LVouYBKzdGUazxO 6DjEZh1tNXsxgWy xUFqgkZe0NleY/+A37Fjn+jidnO1a jv2a1gpxZ07tEfo Q4VvfPaNwUgnvBv NPUHUZiZT/J0GgOoTDMDGKq5H I/kJ1rg++EKblUCsx b62+G/ldw9l9V6CFCNOPp VnD9vGhOMyQaYMu wjlWvS30OW1EDow 71GNDPs5MFQ/Mg/Vpw9NfB4GAv3g2N 7F/Exmwg6bObuSZruO 2isWQRDs4v8yDFQ P0SAETEO5LFYzrm/QalUJAg2VBFlNws 5vuxVxotpWkNvO0 cr4=
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.V iewStateExcepti on.ThrowError(E xception inner, String persistedState, String errorPageMessag e, Boolean macValidationEr ror) +171
System.Web.UI.V iewStateExcepti on.ThrowMacVali dationError(Exc eption inner, String persistedState) +37
System.Web.UI.O bjectStateForma tter.Deserializ e(String inputString) +329
System.Web.UI.O bjectStateForma tter.System.Web .UI.IStateForma tter.Deserializ e(String serializedState ) +30
System.Web.UI.U til.Deserialize WithAssert(ISta teFormatter formatter, String serializedState ) +52
System.Web.UI.H iddenFieldPageS tatePersister.L oad() +256
System.Web.UI.P age.LoadPageSta teFromPersisten ceMedium() +137
System.Web.UI.P age.LoadAllStat e() +102
System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +5916
System.Web.UI.P age.ProcessRequ est(Boolean includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +188
System.Web.UI.P age.ProcessRequ est() +112
System.Web.UI.P age.ProcessRequ estWithNoAssert (HttpContext context) +37
System.Web.UI.P age.ProcessRequ est(HttpContext context) +135
ASP.homepage_as px.ProcessReque st(HttpContext context) +29
System.Web.Call HandlerExecutio nStep.System.We b.HttpApplicati on.IExecutionSt ep.Execute() +401
System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean& completedSynchr onously) +117
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.42; ASP.NET Version:2.0.507 27.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 ..
I'm Mathiyalgan... Working as asp.net developer in a small software concern . I've seen ur Article in the website...4guys fromrolla... 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.Http Exception: 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:
<configuratio n>
<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.Conf iguration.Machi neKeySection.Ge tDecodedData(By te[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +398
System.Web.UI.O bjectStateForma tter.Deserializ e(String inputString) +294
[ViewStateExcept ion: 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 +4tiPdperHNthYn 4LEQ+Snb8ThHwHa oIb0AsBRTVv08Hw BlHxkDtsddltdJA sIXx4IUsSg01fbb kZKaqMLPFCDXMqo eGSqmnNr5puKJOz U6uEZT2XZr8g8lL z+gHWDI+RuS7mw+ rwWuiSbYOB3e8XU 0/Rl9fqyO6v0wF+LA sAl5RDD26BnyGBj LVouYBKzdGUazxO 6DjEZh1tNXsxgWy xUFqgkZe0NleY/+A37Fjn+jidnO1a jv2a1gpxZ07tEfo Q4VvfPaNwUgnvBv NPUHUZiZT/J0GgOoTDMDGKq5H I/kJ1rg++EKblUCsx b62+G/ldw9l9V6CFCNOPp VnD9vGhOMyQaYMu wjlWvS30OW1EDow 71GNDPs5MFQ/Mg/Vpw9NfB4GAv3g2N 7F/Exmwg6bObuSZruO 2isWQRDs4v8yDFQ P0SAETEO5LFYzrm/QalUJAg2VBFlNws 5vuxVxotpWkNvO0 cr4=
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.V iewStateExcepti on.ThrowError(E xception inner, String persistedState, String errorPageMessag e, Boolean macValidationEr ror) +171
System.Web.UI.V iewStateExcepti on.ThrowMacVali dationError(Exc eption inner, String persistedState) +37
System.Web.UI.O bjectStateForma tter.Deserializ e(String inputString) +329
System.Web.UI.O bjectStateForma tter.System.Web .UI.IStateForma tter.Deserializ e(String serializedState ) +30
System.Web.UI.U til.Deserialize WithAssert(ISta teFormatter formatter, String serializedState ) +52
System.Web.UI.H iddenFieldPageS tatePersister.L oad() +256
System.Web.UI.P age.LoadPageSta teFromPersisten ceMedium() +137
System.Web.UI.P age.LoadAllStat e() +102
System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +5916
System.Web.UI.P age.ProcessRequ est(Boolean includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +188
System.Web.UI.P age.ProcessRequ est() +112
System.Web.UI.P age.ProcessRequ estWithNoAssert (HttpContext context) +37
System.Web.UI.P age.ProcessRequ est(HttpContext context) +135
ASP.homepage_as px.ProcessReque st(HttpContext context) +29
System.Web.Call HandlerExecutio nStep.System.We b.HttpApplicati on.IExecutionSt ep.Execute() +401
System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean& completedSynchr onously) +117
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.42; ASP.NET Version:2.0.507 27.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 ..