Regarding Base-64: Trying to solve an ASP.NET issue…
March 27, 2008
Hopefully, some of you fellow ASP.NET/C# programmers out there who’ve found this blog while looking for the Visual Studio 2008 post can give me a hand with these issues:
Invalid length for a Base-64 char array.
Error Message:
Invalid length for a Base-64 char array.
ExceptionType:
System.FormatException
Stack Trace:
at System.Convert.FromBase64String(String s)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
Invalid character in a Base-64 string.
Error Message:
Invalid character in a Base-64 string.
ExceptionType:
System.FormatException
Stack Trace:
at System.Convert.FromBase64String(String s)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
I’ve been browsing forums and newsgroups most of the day trying to figure out what might be going on with both/either of these errors, but I’ve had no real luck so far. Any help from the community is very much appreciated in regard to this issue.
Thanks!
-Will





April 9, 2008 at 1:23 pm
Will,
Other than to say I get them occasionally too, I don’t have any help for you. No specific page or control causes it and it seems to occur quite randomly.
One day I hope to find out why they happen but to be honest I’m not losing too much sleep over it (Until it stops me getting to zero bugs that is
)
If you ever find out anything I’d be interested to hear.
Justin
April 9, 2008 at 5:56 pm
Justin,
Are you using any Telerik controls in your web application? I found a tip in their forums that might help you out. (We’ve implemented the “fix” in our own application, but I haven’t been able to fully monitor the results yet.)
http://www.telerik.com/community/forums/thread/b311D-cgcdh.aspx#99888
The “fix” is to add the following line to web.config (within the system.web node):
<pages enableViewStateMac=”false” />
Let me know if this helps you out.
Thanks for commenting!
-Will
April 9, 2008 at 6:05 pm
Here’s the code snip from the telerik page linked above:
<?xml version="1.0"?><configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<system.web>
<pages enableViewStateMac="false" />
</system.web>
</configuration>
April 10, 2008 at 4:29 pm
I do indeed use Telerik controls (for now). In the environment the error is coming in on, setting enableViewStateMac to false is acceptable so that will be the way I go.
Less than ideal from Telerik I guess but I can live with it.
Thanks for following up, appreciate it.
Justin
April 10, 2008 at 6:47 pm
Justin,
Just out of curiosity, are you using the Prometheus version of the RadControls, or the previous version?
-Will
April 11, 2008 at 10:20 am
Previous version (Q1 2007), my subscription license has now expired.
I am mid way through migrating old code to
Native .NET TreeView
FCKEditor - http://www.fckeditor.net/
ZedGraph - http://zedgraph.org/
as open source alternatives with a great deal of success. TreeView isn’t so great, my eyes are on extJS .NET projects such as Coolite for this one but we get by.