asp.net - System.Web.HttpException: Unable to validate data - after publishing site -


i have written following code login:

 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             }         } 

which running fine while running through visual studio. when published it showing below error:

system.web.httpexception: unable validate data

note:

  1. i publish application on same server on developing site.

  2. i have tried enableviewstatemac = false on page level. [login page]

what reson of error? why appears when have published site?

i have changed way encrypt string , problem disapperars. have no idea reason of error, resolved this. hope others, facing same issue.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -