Powering thousands of Online Stores, Shopping Carts, around the world!

PDshop is built on Asp.Net, works with ALL Windows web hosts and Windows servers!
Powered by Asp.Net Learn More
How to fix the "Server Error in '/' Application - Validation of viewstate MAC failed" error
Sample Error
You may get a message like "Server Error in '/' Application"

Or it may say "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.
Solution or Workaround
IMPORTANT NOTE: If you recently started experiencing this error, and it consistency occurs while editing an Order, Uploading an Image, or when using the shop's Contact Us page, than please download & install the latest revision of your edition of PDshop.  Earlier revisions of some of PDshop's .aspx scripts may not work with newer versions of Microsoft's ASP.NET Framework.

While we recommend downloading the latest revision, which usually does resolve the above issue, you can try a different approach.  

WORKAROUND #1
An alternate solution would be to add the enableViewStateMac="false" code to the "pages" settings of the system.web section of your web.config file.  

For example, in your web.config change:
<pages buffer="true" enableViewState="true" enableSessionState="false"
autoEventWireup="true" validateRequest="false" />

To this:
<pages buffer="true" enableViewStateMac="false" enableViewState="true"
enableSessionState="false" autoEventWireup="true" validateRequest="false" />

WORKAROUND #2
Another workaround can be to set enableEventValidation to false and viewStateEncryptionMode to Never as follows in the "pages" settings of the system.web section of your web.config file:

enableeventvalidation="false"
viewstateencryptionmode="Never"

For Example:
<pages buffer="true" enableViewStateMac="false" enableViewState="true"
enableSessionState="false" autoEventWireup="true" validateRequest="false" enableeventvalidation="false" viewstateencryptionmode="Never" />


MORE INFO & ADDITIONAL TROUBLESHOOTING:
Like most asp.net applications, PDshop relies on certain features built into Microsoft’s .Net Framework (built into your web server).  In order to facilitate fast loading of pages and what’s known as “postback” features, PDshop utilizes Microsoft’s Viewstate functionality.

If you receive an asp.net “Viewstate” error after clicking “Save” or “Continue” in PDshop or PDAdmin, this can indicate a web server problem.   However, if you have left your web browser open for a long period of time, or configuration on the web server was changed while you were on a PDshop page, you may need to close your web browser, and then restart it (or, clearing your web browser's cache and temporary internet files may resolve this).

If the problem persists, than it’s likely your web server is out of resources (such as memory) and may be prematurely discarding asp.net viewstate data from its memory, the server is rebooting/recycling abnormally, or there is a configuration problem with the web server itself.  For these issues you would need to contact your web hosting service (or the server’s administrator).

NOTE: if you are using a “shared” web server, this problem can be an indication of an overloaded server; in other words your host may have more clients/websites setup on your server, than the server can physically support.  Or, you may have reached the limitations of shared hosting (in which case a better plan or dedicated server is recommended).
Related Articles
Related Topics
Article Applies to: ASP.NET (Microsoft's .NET)
Search for help...

Updates

No updates or new downloads are currently available.  Check back later for news and updates on products we may be developing.