473,506 Members | 17,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

view state mac failed

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
<machineKeyconfiguration specifies the same validationKey and validation
algorithm.

Any help is very much appreciated
Nalaka
Jul 6 '06 #1
4 1144
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.)


Jul 7 '06 #2
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.)

Jul 11 '06 #3
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]" <st*****@online.microsoft.comwrote in message
news:cn**************@TK2MSFTNGXA01.phx.gbl...
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.)

Jul 11 '06 #4
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.)

Jul 12 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2075
by: Madhivanan | last post by:
It is possible to drop the table without dropping the view referencing it. How do I force integrity? Madhivanan
1
15454
by: Michael | last post by:
Hi, Any one know the problem of the following error: Thanks, m Failed to load viewstate. The control tree into which viewstate is being loaded must match the control tree that was used to...
2
783
by: Brad | last post by:
I have an intranet app that has just started sporadically getting the following error "The viewstate is invalid for this page and might be corrupted." By sproadic I mean 3-4 times during the past...
3
2111
by: Philip Tripp | last post by:
I've read numerous sources stating that view state can be disabled per control, and per page, but can't seem to keep web form controls from remembering their state on a postback. I'm using VS.Net...
2
1394
by: Joey | last post by:
Hi There, I have a page that has 2 listbox contols on it, the page also has a form with a 10 textboxes and a few labels. When the page loads at runtime it takes way too long to apear and then...
10
8770
by: Zack Sessions | last post by:
Has anyone tried to create a SQL7 view using the CREATE VIEW command and ADO.NET? If so, is there a trick in trapping a SQL error when trying to create the view? I have a VB.NET app that, amoung...
20
1979
by: raptor | last post by:
hi, I want to make the following thing : select-based updatable VIEW, which have two more virtual-fields. One of them is concatenation of others and the second is calculated on the fly. Can I...
104
10757
by: Beowulf | last post by:
I have the view below and if I use vwRouteReference as the rowsource for a combo box in an MS Access form or run "SELECT * FROM vwRouteReference" in SQL Query Analyzer, the rows don't come through...
12
7478
by: Doug | last post by:
Hi, I learned a little about the model view presenter pattern at a conference this last week and am experimenting with it. It's working pretty well but I have a question. I am trying to use...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7105
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.