Validation of viewstate MAC failed

D

Deborggraeve Randy

I have some problems with a site project im working on.

It should be easy, but im running into an error.

My page has a server sided form and client sided (basic html) textboxes, a
button and a simple jscript to submit the form to an other page.
Currently there are no asp.net controls on the page.

I have been looking on different forums and no solution to be found, it
seems te be a bug in the .NET framework.

When i submit the form i get this 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. AutoGenerate cannot be used in a
cluster.

ASPX Page:


<form id="form1" runat="server">
<input id="Button1" type="button" value="button" onclick="Form_Submit()"
/><br />
<input name="Text1" id="Text1" type="text" /><br />
<input name="test2" id="Text2" type="text" /><br />
</form>


Java Script:
function Form_Submit()

{

document.forms[0].action = "test.aspx";

document.forms[0].submit();

}
 
D

Dominick Baier [DevelopMentor]

Hi,

what you are trying to do is against how ASP.NET works - ASP.NET uses the
single page model - the viewstate you send to the other page cannot be parsed
(and there is some viewstate when you look in the hidden fields in HTML)

either post back to the same page - parse the data and do the redirect on
the server or use the new asp.net cross page postback facility.
 
D

Deborggraeve Randy

Problem is we are working with different persons on the site, using source
safe ...
So we cant edit pages at the same time

Dominick Baier said:
Hi,
what you are trying to do is against how ASP.NET works - ASP.NET uses the
single page model - the viewstate you send to the other page cannot be
parsed (and there is some viewstate when you look in the hidden fields in
HTML)

either post back to the same page - parse the data and do the redirect on
the server or use the new asp.net cross page postback facility.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
I have some problems with a site project im working on.

It should be easy, but im running into an error.

My page has a server sided form and client sided (basic html)
textboxes, a
button and a simple jscript to submit the form to an other page.
Currently there are no asp.net controls on the page.
I have been looking on different forums and no solution to be found,
it seems te be a bug in the .NET framework.

When i submit the form i get this 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. AutoGenerate cannot be used in
a
cluster.
ASPX Page:

<form id="form1" runat="server">
<input id="Button1" type="button" value="button"
onclick="Form_Submit()"
/><br />
<input name="Text1" id="Text1" type="text" /><br />
<input name="test2" id="Text2" type="text" /><br />
</form>
Java Script:
function Form_Submit()
{

document.forms[0].action = "test.aspx";

document.forms[0].submit();

}
 
D

Deborggraeve Randy

Anyway ... i found a temporary solution, by settings AllowViewStateMac to
false on the page is post the form to
Once the site is completed the form post code will be moved the the form
page itself

Dominick Baier said:
Hi,
what you are trying to do is against how ASP.NET works - ASP.NET uses the
single page model - the viewstate you send to the other page cannot be
parsed (and there is some viewstate when you look in the hidden fields in
HTML)

either post back to the same page - parse the data and do the redirect on
the server or use the new asp.net cross page postback facility.

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
I have some problems with a site project im working on.

It should be easy, but im running into an error.

My page has a server sided form and client sided (basic html)
textboxes, a
button and a simple jscript to submit the form to an other page.
Currently there are no asp.net controls on the page.
I have been looking on different forums and no solution to be found,
it seems te be a bug in the .NET framework.

When i submit the form i get this 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. AutoGenerate cannot be used in
a
cluster.
ASPX Page:

<form id="form1" runat="server">
<input id="Button1" type="button" value="button"
onclick="Form_Submit()"
/><br />
<input name="Text1" id="Text1" type="text" /><br />
<input name="test2" id="Text2" type="text" /><br />
</form>
Java Script:
function Form_Submit()
{

document.forms[0].action = "test.aspx";

document.forms[0].submit();

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,113
Latest member
Vinay KumarNevatia
Top