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:
i publish application on same server on developing site.
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
Post a Comment