asp.net - Invalid length for a Base-64 char array -


I'm using asp.net + MVC1.0 and have the web page are several forms that I say The following function AntiForgeryToken () to generate a hidden value, and in the controller function I have a valid attribute.

When I use JMeter and capture token token post with my form from the server using regular expressions, I found that it is throwing an exception:

 < Code>  Description:  An uncontrolled exception occurred during the execution of existing web requests. Please review the stack trace for more information about the error and where the code has originated from it.  Exception Description:  System Format exception: invalid length for base-64 character array. An unrestricted exception was generated during the execution of the existing web request. Exceptions about the origin and location of the exception can be identified using the exception stack trace.   Version information:  & nbsp; Microsoft .NET Framework Version: 2.0.50727.3603; ASP.NET version: 2.0.50727.3082 [FormatException]: invalid length for base-64 character array. On System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize (string serializedState) on System.Web System.Convert.FromBase64String (string s) on System.Web.UI.ObjectStateFormatter.Deserialize (string inputString) .Mvc.AntiForgeryDataSerializer.Deserialize (string Sirijlaijd token) [HttpAntiForgeryException]: a necessary anti-counterfeiting was not token or illegal. System.Web.Mvc.AntiForgeryDataSerializer.Deserialize (String serializedToken) on System.Web.Mv.ValidateAntiForgeryTokenAttribute.OnAuthorization (Authority Contact FilterContax) System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters (Controller Content Controller Contains, IList`1 Filter, Action descriptors action descriptors) System.Web.Mvc.ControllerActionInvoker.InvokeAction (ControllerContext controllerContext, string actionName) on System.Web.Mvc.Controller.ExecuteCore () on System.Web.Mvc.ControllerBase.Execute (requestContext requestContext) System.Web. On at Mvc. On System.Web.Mvc.MvcHandler.ProcessRequest (HttpContextBase HttpContext) on System.Web.Mvc.MvcHandler.ProcessRequest (HttpContext HttpContext) on ControllerBase.System.Web.Mvc.IController.Execute (requestContext requestContext) System.Web.Mvc. MvcHandler.System.Web.IHttpHandler.ProcessRequest (HttpContext HttpContext) System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.Ht at tpApplication.IExecutionStep.Execute () System.Web.HttpApplication.ExecuteStep (IExecutionStep is the step, boolean and completedSynchronously ) This error page may contain sensitive information because the & lt verbose error message is configured by using ASP.NET; CustomErrors mode = "off" />. & Lt; CustomErrors mode = "on" /> Or & lt; CustomArsers mode = "RemoteOnly" /> 

In the production environment and I'm sure the captured token is what we create, why this exception happened?

Just solved, because I did not token before posting server.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -