I have created a custom error page and update it using to webApplication using following code:
My error page contains one link button and onClick event, I have to perform some operations.
As I click on the button Error is occurred and onClick event code didn't execute.
If I render custom error page by providing url in IE like
http://myweburl/_layouts/myerrorpage then every thing is working fine i.e. every event is working fine.
Also If I use SPUtility.Redirect() method instead of SPUtility.TransferToErrorPage() then also every thing is working fine.
My error message is as follow in case of SPUtility.TransferToErrorPage():
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.
[HttpException (0x80004005): Unable to validate data.]
System.Web.Configuration.MachineKeySection.GetDecodedData(Byte buf, Byte modifier, Int32 start, Int32 length, Int32& dataLength) +10988853
System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +295
[ViewStateException: Invalid viewstate.
Client IP: fe80::8960:150e:cf5d:2e17%11
View Complete Post