title: System.Web.HttpException: Unable to validate data - after publishing site
body: <p>I have written the following code for login:</p>
  
  <pre><code> Session["IsLogin"] = false;
          System.Configuration.Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~");
          if (txtPassword.Text.Trim() == string.Empty)
          {
              // Display Error
          }
          else
          {
              string Pwd = config.AppSettings.Settings["PWD"].Value.ToString();
              FormsAuthenticationTicket formAuthTk = FormsAuthentication.Decrypt(Pwd);
              string strDcryptedPwd = formAuthTk.Name.Trim().ToString();
              if (txtPassword.Text.Trim() == strDcryptedPwd)
              {
                  Session["IsLogin"] = true;
                  Response.Redirect("AnyPage.aspx");
              }
              else
              {
                  // Error, Wrong password
              }
          }
  </code></pre>
  
  <p>Which is running fine while running through Visual studio. But when I published it it is showing the below error:</p>
  
  <blockquote>
    <p>System.Web.HttpException: Unable to validate data</p>
  </blockquote>
  
  <p>NOTE:</p>
  
  <ol>
  <li><p>I publish the application on the
  same server on which I am developing
  the site.</p></li>
  <li><p>I have tried EnableViewStateMAC =
  false on page level. [Login Page]</p></li>
  </ol>
  
  <p>What is the reson of this error? Why it is only appears when I have published the site?</p>