Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesenableViewStateMac="true" causing error?enableViewStateMac="true" causing error?
Previous
 
Next
New Post
4/21/2010 3:14 PM
 

I have a set of modules that process online payments.  When a user makes a payment, I "POST" to my credit card processor's gateway, the user enters their credit card info on the gateway's PCI Compliant page.  After the gateway processes the payment, they redirect back to my site via a "POST" (I think).

When my PaymentApproved page loads, I get the following error:

Error      An error has occurred.
DotNetNuke.Services.Exceptions.PageLoadException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. ---> System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. ---> System.Web.UI.ViewStateException: Invalid viewstate. Client IP: 127.0.0.1 Port: 4908 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) ViewState: /wEPDwUJLTc1MDYyMzU4DxYcHg5FQ09NUmVzcG9uc2VJRAUkNjRmYTA4MjEtMzg0OC00MmU0LTkzMTMtYzQzMTZhNWUwMDE1HhBDcmVkaXRDYXJkTnVtYmVyBQQwMDAwHgxSZXNwb25zZVRleHQFECAgTk8gIE1BVENIICAgICAeE1B1cmNoYXNlSWRlbnRpZmllcjIFIFVCOjAxLTEwMDMwMC0wMTo1MC4wMDoyLjI1OjUyLjI1HgxSZXNwb25zZUNvZGUFAjAwHhNQdXJjaGFzZUlkZW50aWZpZXIxBSQ4OGYxMzdhMy0yNGU0LTQzMjktYjU0Mi1iMTRiNzBkYWVhYTkeC1JlZGlyZWN0VVJMBWdodHRwOi8vbG9jYWxob3N0L215bGF3ci9PbmxpbmVQYXltZW50cy9VdGlsaXR5QWNjb3VudFBheW1lbnRzL3RhYmlkLzYwL2NpZC9wYXltZW50YXBwcm92YWwvRGVmYXVsdC5hc3B4HhFUcmFuc2FjdGlvbkFtb3VudAUFNTIuMjUeDVRyYW5zYWN0aW9uSUQFJntDRTIxRjJFMC0xQkFELTRBNjQtOUI2RS0zQzMyRTE3N0U1NUR9Hg1FQ09NUmVxdWVzdElEBSZ7MUY1RjkyODUtOEYyQS00MUM2LTg5M0ItODZEQUMzRjA1OENCfR4YQ3JlZGl0Q2FyZEV4cGlyYXRpb25EYXRlBQQwNTEwHg5DcmVkaXRDYXJkVHlwZQUEVklTQR4NQVZTUmVzdWx0Q29kZQUBTh4MQXBwcm92YWxDb2RlBQZFVFNNUzMWAgIBDxYCHgZhY3Rpb24FZ2h0dHA6Ly9sb2N... ---> System.Web.HttpException: Unable to validate data. at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) --- End of inner exception stack trace --- --- End of inner exception stack trace --- at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) at System.Web.UI.HiddenFieldPageStatePersister.Load() at System.Web.UI.Page.LoadPageStateFromPersistenceMedium() at System.Web.UI.Page.LoadAllState() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

I did a little research an found that if I set enableViewStateMac="false" in the web.config that my problem was solved.

My question is, how does this effect the overall security & etc for my site?  Is there a way to set enableViewStateMac="false" for only one page?

 
New Post
4/21/2010 3:36 PM
 

Looks like I can add the following to the page and I won't have to change the web.config.

        Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
            Me.Page.EnableViewStateMac = False
        End Sub

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesenableViewStateMac="true" causing error?enableViewStateMac="true" causing error?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out