net applications webapp1 and webapp2, in each application i have a asp.net form Deafult.aspx
I want to do a form submit from Default.aspx in webapp1 and recieve the value in webapp2.
I tried to do it with simply setting action ="webapp2 location" but it is throwing the bellow error
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.
I even added the machinekey element to web.config
but it is still showing the same error.
This is the code for webapp1 form which sends data to webapp2
<form id="form1" method="post" runat="server" action="http://localhost/webValRec/Default.aspx">
<div>
<asp:Label ID="Label1" runat="server" Text="Value to pass "></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
The code for the form that recieves values and displays in label
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
the code behind to set the label value
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Convert.ToString(Request.Form["TextBox1"]);
}
}
Thank you