Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Invalid length for a Base-64 char array

9 views
Skip to first unread message

danc

unread,
Dec 16, 2004, 11:13:05 AM12/16/04
to
I keep getting this error. I have scoured the web and could not find any
applicable information. It seems to have really started since I upgraded to
the 1.1 framework. Any help is appreciated.

Using:
*ASP.NET 1.1
*Single machine (no clusters)
*Simple postbacks (no postbacks to different pages)
*Using only Response.Redirect() when applicable
*The page works fine. The error appears at random occasions.
*I have not been able to repro the error on my dev machine. It happens only
on my production server.


UNHANDLED Exception:
[FormatException: Invalid length for a Base-64 char array.]
System.Convert.FromBase64String(String s)
System.Web.UI.LosFormatter.Deserialize(String input)
System.Web.UI.Page.LoadPageStateFromPersistenceMedium()

[HttpException: Invalid_Viewstate_Client_Disconnected
Client IP: 204.231.101.39
Port: 1585
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322)
ViewState:
***50,369 bytes of base64 text***
Http-Referer: http://198.137.76.44/appman/ManageCustomer.aspx
Path: /appman/ManageCustomer.aspx.]
System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
System.Web.UI.Page.LoadPageViewState()
System.Web.UI.Page.ProcessRequestMain()


User Name: xxxx
SessionID: jqg1cr45bvomc445vefeli45
Form Data:
__EVENTTARGET = "Customers"
__EVENTARGUMENT = ""


Thanks in advance,

Dan

Brad Roberts

unread,
Dec 16, 2004, 11:33:06 AM12/16/04
to
Sounds like some of the base64 encoded characters are not making it back to
the server without modification. The same problem occurs when base64
characters are used in a URL. To be used in a URL they have to be URLEncoded,
too.

Try using HTMLEncode() on the base64 data before sending it to the browser.

bruce barker

unread,
Dec 16, 2004, 12:57:41 PM12/16/04
to
the error is coming from the framework trying to load the __viewstate hidden
field. the common cause for this error, is the viewstate is very large, and
a proxy server is truncating it, causing the error. be sure your length of
your viewstate is under 2k.

-- bruce (sqlwork.com)

"danc" <da...@discussions.microsoft.com> wrote in message
news:7BB57F29-D095-427E...@microsoft.com...

danc

unread,
Dec 16, 2004, 5:21:01 PM12/16/04
to
Bruce,

The puzzle is that things work sometime and not others, so I don't know why
there would be a length limit that takes effect only some times (the exact
same data is being transferred). The large viewstate is the result of a
DropdownList control (I will look into removing the need for viewstate) and
is definitively larger than 2K. Other pages use a DataGrid control with an
even larger viewstate and have this problem only rarely (if at all).

I wonder if "Invalid_Viewstate_Client_Disconnected" is a clue.

Any other thoughts?

Regards,

Dan

SmashHuevo

unread,
Apr 21, 2005, 4:08:03 PM4/21/05
to
I'm seeing this error, as well--and it seems to come from the fact that our users will do something that triggers a postback (e.g. select an item from a DropDownList), and then do something that triggers another one, before the first request has returned. This seems to truncate the viewstate mid-request, and cause this error.

Anyone have any ideas on how to fix this?

User submitted from AEWNET (http://www.aewnet.com/)

Alvin Bruney [MVP - ASP.NET]

unread,
Apr 21, 2005, 7:21:08 PM4/21/05
to
nope, i don't think that is the case. i'm looking into this issue with
microsoft under thread invalid viewstate. if you can reproduce it please
send email to vapo...@hotmail.com subject line invalid viewstate

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
"SmashHuevo" <SmashHuevo@aew_nospam.com> wrote in message
news:ulbFU3qR...@TK2MSFTNGP14.phx.gbl...

0 new messages