Red Gate forums :: View topic - Validation of viewstate MAC failed
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
ANTS Load
ANTS Load forum

Validation of viewstate MAC failed

Search in ANTS Load forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
Lakshmi



Joined: 17 May 2006
Posts: 11
Location: Mysore

PostPosted: Sat Feb 24, 2007 2:49 pm    Post subject: Validation of viewstate MAC failed Reply with quote

Hi,

We are getting this error when we create ANTS Load script. We have now changed the web.config to add the following line:
<pages enableViewStateMac="false" enableEventValidation="false"
viewStateEncryptionMode="Never" maxPageStateFieldLength="200" />

Though the error does not occur, the database does not get updated with records.......We have also hard coded the view state, but the main click event or POst does not happen....the code does not get called for the final save event.

Could anyone please help on that?

Regards,
Lakshmi
_________________
Lakshmi
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Sun Feb 25, 2007 7:15 pm    Post subject: Reply with quote

Hi,

The Viewstate is the most common beastie that happens when trying to load test an ASP .Net application. Just search this forum to see the various and vicious ways that this happens. More than likely your fix is not helping because viewstate is dynamic and hard-coding it will only lead to different errors.

There seems to be a basic problem with viewstate in your load test. The message about the viewstate MAC, which relates to encryption, is probably a red herring. The real problem is that the viewstate you're sending back to the server is just plain wrong.

The most common cause of this relates to websites that use frames or iframes. This causes viewstate to be sent back to the server for the wrong page, because ANTS Load only has one slot for viewstate data, it is not maintained per-page. Therefore, if your web browser session recorded a request for page a, then b, then c, and your form posts to page b, the viewstate for page c gets posted back to page b.

So what you would need to do is edit your script so that the GET request for page b happens right before the POST to page b. You can try the ANTS Script tester from http://labs.red-gate.com to try to figure out exactly where the breakdown is occurring.
Back to top
View user's profile Send private message
Lakshmi



Joined: 17 May 2006
Posts: 11
Location: Mysore

PostPosted: Tue Feb 27, 2007 12:57 pm    Post subject: Reply with quote

Hi Brian,

We have already put a GET before every post to get the correct view state....

Also, we have used Fiddler, and the View state from there for each post and hard coded the same and have tried sending the post but does not seem to work.

We have a problem where a particular save button event does not get fired, because of which we are unable to save to the database.....any insights into this would be helpful.

Thanks and Regards,
Lakshmi
_________________
Lakshmi
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Tue Feb 27, 2007 10:41 pm    Post subject: Reply with quote

Hard-coding the viewstate is a very bad idea. Did the script tester reveal anything?
Back to top
View user's profile Send private message
Lakshmi



Joined: 17 May 2006
Posts: 11
Location: Mysore

PostPosted: Wed Feb 28, 2007 6:13 am    Post subject: No Records being inserted into the Database Reply with quote

Hi Brian,

We did use the script tester, but we got nothing from there.....

We do not get the error of the View state failed....but no records get inserted into the database.....

Note: At times just putting the GET does not help to get the viewstate.

Regards,
Lakshmi
_________________
Lakshmi
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Brian Donahue



Joined: 23 Aug 2004
Posts: 6677

PostPosted: Wed Feb 28, 2007 10:14 am    Post subject: Reply with quote

This looks like one of the typical application-specific errors to do with ANTS Load. I can't help really, except to suggest using Me.LogToFile on your sessions' scripts and seeing if the pages returned in the response content are correct. In a few cases, the scripts work once, but fail on subsequent attempts because of data that is meant to be dynamic being static in the ANTS Load script, or a script not logging the user out at the end, the result is usually a bunch of 'you must log in' pages in the second run.
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group