を公開した後、私は、ログインのために以下のコードを書かれている:System.Web.HttpException:データを検証できません - サイト
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
}
}
のVisual Studioを通じて実行中に細かい実行されています。私はそれを公開したときにしかし、以下のエラーを示している。
System.Web.HttpException: Unable to validate data
注:
私は サイトを開発していた上 同じサーバー上でアプリケーションを公開します。
ページレベルでEnableViewStateMAC = を試してみました。 [ログインページ]
このエラーの響きは何ですか?サイトを公開したときに表示されるのはなぜですか?
VS2008から実行中にエラーが発生することがあります。エラーは 'FormsAuthenticationTicket formAuthTk = FormsAuthentication.Decrypt(Pwd);行にあります。 ' – Chris