Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > view state mac failed

Reply
Thread Tools

view state mac failed

 
 
Nalaka
Guest
Posts: n/a
 
      07-06-2006
Hi,
I get this error (below) under the following condition on asp.net 2.0.

I have a page that is working fine.
Then I add a JavaScript provided by "commission junction" to show an ad.



Error:
------
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.



Any help is very much appreciated
Nalaka


 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      07-07-2006
Hello Nalaka,

Thank you for posting in the ASP.NET newsgroup.

From your description, you have an ASP.NET 2.0 web application which is
suffering the "view state mac failed" error, also this application has use
some add-on scripts for client-side manipulation, correct?

Based on my experience, the following things may cause such exception:

1. If your application is deployed in webfarm scenario, since different
machine have different machinekey settings, it may cause viewstate mac
validation fails. BTW, ViewStateMac validation is enabed by default in
ASP.NET 2.0.

2. If you're not using webfarm setting, it is likely the page's viewstate
is modified for some reason at client-side so that when the runtime
validating it after postback, the exception thrown out. As you mentioned
that you're using some "commission junction" scripts, would you provide
some further info on these scripts or would it affect any form element in
the page's html document? For general testing, you can isolate the problem
by checking whether the problem is specific to those particular scirpts.

Hope this helps.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      07-11-2006
Hi Nalaka,

How are you doing on this issue? Have you got any further progress or does
the info in my last reply helps you a little? If there is still anything we
can help, please feel free to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
Nalaka
Guest
Posts: n/a
 
      07-11-2006
Hi Steven,
It is when I put the javascript (from commision Junction) that this happens.
It is possible the script modifies something on the client.
For now I swithced to an alternative non javascript method.

I tried various methods on the page directive (
enableEventValidation="false" viewStateEncryptionMode ="Never"
EnableViewStateMac="false" etc.)
Non of these methods was successful.

Nalaka


"Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Nalaka,
>
> How are you doing on this issue? Have you got any further progress or does
> the info in my last reply helps you a little? If there is still anything
> we
> can help, please feel free to post here.
>
> Regards,
>
> Steven Cheng
> Microsoft MSDN Online Support Lead
>
>
> ==================================================
>
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
>
> ==================================================
>
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>



 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      07-12-2006
Hi Nalaka,

Thanks for your response.

The ASP.NET's ViewState is by default persisted through the

<input name="__VIEWSTAT" ... />

html hidden field. Therefore, it is likely that the commision Unction
scripts has corrupt the hidden field's value. If you can build a very
simple page to reproduce the problem, you can view the page's client-side
html source (in web browser) and check those client scripts to see whether
any of them is accessing the hidden form element.

Another troubleshooting approach is use some http trace tools (such as
fidder or tcptrace or trace utility) to capture the page's http request/
response. We can verify the <input name="__VIEWSTAT" ... /> value after it
is sent to client and before it is postback again to server. If there
value is different, there is certainly some client-script that has modified
it.

Hope this helps some.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed to load view state VijayRama ASP .Net 1 10-12-2009 01:57 PM
Deploying application in domain failed; WSGEN FAILED in Netbeans6.1with Glassfish kiran Java 5 07-09-2008 09:17 PM
Errors: Failed to load viewstate. & Validation of viewstate MAC failed. sck10 ASP .Net 6 09-01-2006 05:59 PM
How to make a week view and day view calendar just like month view calendar in .NET ? Parthiv Joshi ASP .Net Web Controls 1 07-06-2004 03:15 PM
QueryInterface for interface Excel._Application failed / QueryInterface for interface Word._Application failed SOLUTION Wildepiet ASP .Net 0 06-14-2004 07:28 AM



Advertisments