Invalid length for a Base-64 char array

W

Wayne Sepega

I'm receiving the above error from time to time with one of our web pages.
What would cause this?
Thanks
Wayne

The following is the stacktrace from the exception:

System.Web.HttpUnhandledException: Exception of type
'System.Web.HttpUnhandledException' was thrown. ---> System.FormatException:
Invalid length for a Base-64 char array. at
System.Convert.FromBase64CharArray(Char[] inArray, Int32 offset, Int32
length) at System.Web.HttpServerUtility.UrlTokenDecode(String input) at
System.Web.UI.Page.DecryptString(String s) at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack
trace --- at System.Web.UI.Page.HandleError(Exception e) at
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) at
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at
System.Web.UI.Page.ProcessRequest(HttpContext context) at
ASP.alerts_add_aspx.ProcessRequest(HttpContext context) at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
 
G

Guest

Most likely your alerts_add_aspx page has data being posted that fails
validation (illegal characters, elements added to a dropdownlist after the
page was rendered, etc).

There are attributes to turn page validation and event validation off, but
they also
come with less security protection, which may or may not be an issue in your
environment.
Peter
 
W

Wayne Sepega

The application has been in production for little over a year now. From what
I have been told these exceptions happen from time to time, only reason I
saw the one below was due to the fact that we just did a big deployment and
I had to monitor our systems after it.

I know about the attributes to turn off the page validation, I went to great
lengths to keep this on when writing the app, so at this point turning it
off isn't an option.

We do our own encryption and decryption of the query strings, but that code
isn't showing in the stack trace, and as such I'm a bit lost on what the
issue could be. I just forced the decryption to except by modifying the
query string and I get a different exception, as well as the stack trace
includes my method for decrypting the query string.

Any suggestions on what I can do to track this down?
Wayne


Peter Bromberg said:
Most likely your alerts_add_aspx page has data being posted that fails
validation (illegal characters, elements added to a dropdownlist after the
page was rendered, etc).

There are attributes to turn page validation and event validation off, but
they also
come with less security protection, which may or may not be an issue in
your
environment.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net




Wayne Sepega said:
I'm receiving the above error from time to time with one of our web
pages.
What would cause this?
Thanks
Wayne

The following is the stacktrace from the exception:

System.Web.HttpUnhandledException: Exception of type
'System.Web.HttpUnhandledException' was thrown. --->
System.FormatException:
Invalid length for a Base-64 char array. at
System.Convert.FromBase64CharArray(Char[] inArray, Int32 offset, Int32
length) at System.Web.HttpServerUtility.UrlTokenDecode(String input) at
System.Web.UI.Page.DecryptString(String s) at
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack
trace --- at System.Web.UI.Page.HandleError(Exception e) at
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) at
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint,
Boolean includeStagesAfterAsyncPoint) at
System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at
System.Web.UI.Page.ProcessRequest(HttpContext context) at
ASP.alerts_add_aspx.ProcessRequest(HttpContext context) at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,703
Messages
2,569,328
Members
44,612
Latest member
Billysak

Latest Threads

Top