473,803 Members | 1,992 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invalid length for a Base-64 char array

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.Redire ct() 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. FromBase64Strin g(String s)
System.Web.UI.L osFormatter.Des erialize(String input)
System.Web.UI.P age.LoadPageSta teFromPersisten ceMedium()

[HttpException: Invalid_Viewsta te_Client_Disco nnected
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.P age.LoadPageSta teFromPersisten ceMedium()
System.Web.UI.P age.LoadPageVie wState()
System.Web.UI.P age.ProcessRequ estMain()
User Name: xxxx
SessionID: jqg1cr45bvomc44 5vefeli45
Form Data:
__EVENTTARGET = "Customers"
__EVENTARGUMENT = ""
Thanks in advance,

Dan
Nov 19 '05 #1
5 11329
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.

"danc" wrote:
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.Redire ct() 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. FromBase64Strin g(String s)
System.Web.UI.L osFormatter.Des erialize(String input)
System.Web.UI.P age.LoadPageSta teFromPersisten ceMedium()

[HttpException: Invalid_Viewsta te_Client_Disco nnected
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.P age.LoadPageSta teFromPersisten ceMedium()
System.Web.UI.P age.LoadPageVie wState()
System.Web.UI.P age.ProcessRequ estMain()
User Name: xxxx
SessionID: jqg1cr45bvomc44 5vefeli45
Form Data:
__EVENTTARGET = "Customers"
__EVENTARGUMENT = ""
Thanks in advance,

Dan

Nov 19 '05 #2
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**@discussio ns.microsoft.co m> wrote in message
news:7B******** *************** ***********@mic rosoft.com...
| 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.Redire ct() 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. FromBase64Strin g(String s)
| System.Web.UI.L osFormatter.Des erialize(String input)
| System.Web.UI.P age.LoadPageSta teFromPersisten ceMedium()
|
| [HttpException: Invalid_Viewsta te_Client_Disco nnected
| 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.P age.LoadPageSta teFromPersisten ceMedium()
| System.Web.UI.P age.LoadPageVie wState()
| System.Web.UI.P age.ProcessRequ estMain()
|
|
| User Name: xxxx
| SessionID: jqg1cr45bvomc44 5vefeli45
| Form Data:
| __EVENTTARGET = "Customers"
| __EVENTARGUMENT = ""
|
|
| Thanks in advance,
|
| Dan
Nov 19 '05 #3
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_Viewst ate_Client_Disc onnected" is a clue.

Any other thoughts?

Regards,

Dan
"bruce barker" wrote:
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**@discussio ns.microsoft.co m> wrote in message
news:7B******** *************** ***********@mic rosoft.com...
| 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.Redire ct() 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. FromBase64Strin g(String s)
| System.Web.UI.L osFormatter.Des erialize(String input)
| System.Web.UI.P age.LoadPageSta teFromPersisten ceMedium()
|
| [HttpException: Invalid_Viewsta te_Client_Disco nnected
| 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.P age.LoadPageSta teFromPersisten ceMedium()
| System.Web.UI.P age.LoadPageVie wState()
| System.Web.UI.P age.ProcessRequ estMain()
|
|
| User Name: xxxx
| SessionID: jqg1cr45bvomc44 5vefeli45
| Form Data:
| __EVENTTARGET = "Customers"
| __EVENTARGUMENT = ""
|
|
| Thanks in advance,
|
| Dan

Nov 19 '05 #4
I'm seeing this error, as well--and it seems to come from thefact that our users will do something that triggers a postback(e.g. select an item from a DropDownList), and then do somethingthat triggers another one, before the first request hasreturned. This seems to truncate the viewstate mid-request, andcause this error.

Anyone have any ideas on how to fix this?
I keep getting this error. I have scoured the web and could notfind any
applicable information. It seems to have really started since Iupgraded 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.Redire ct() 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. Ithappens only
on my production server.
UNHANDLED Exception:
[FormatException : Invalid length for a Base-64 char array.]
System.Convert. FromBase64Strin g(String s)
System.Web.UI.L osFormatter.Des erialize(String input)
System.Web.UI.P age.LoadPageSta teFromPersisten ceMedium()

[HttpException: Invalid_Viewsta te_Client_Disco nnected
Client IP: 204.231.101.39
Port: 1585
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT5.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.P age.LoadPageSta teFromPersisten ceMedium()
System.Web.UI.P age.LoadPageVie wState()
System.Web.UI.P age.ProcessRequ estMain()
User Name: xxxx
SessionID: jqg1cr45bvomc44 5vefeli45
Form Data:
__EVENTTARGET = "Customers"
__EVENTARGUMENT = ""
Thanks in advance,

Dan

User submitted from AEWNET (http://www.aewnet.com/)
Nov 19 '05 #5
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 va******@hotmai l.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:ul******** ******@TK2MSFTN GP14.phx.gbl...
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?
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.Redire ct() 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. FromBase64Strin g(String s)
System.Web.UI.L osFormatter.Des erialize(String input)
System.Web.UI.P age.LoadPageSta teFromPersisten ceMedium()

[HttpException: Invalid_Viewsta te_Client_Disco nnected
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.P age.LoadPageSta teFromPersisten ceMedium()
System.Web.UI.P age.LoadPageVie wState()
System.Web.UI.P age.ProcessRequ estMain()
User Name: xxxx
SessionID: jqg1cr45bvomc44 5vefeli45
Form Data:
__EVENTTARGET = "Customers"
__EVENTARGUMENT = ""
Thanks in advance,

Dan

User submitted from AEWNET (http://www.aewnet.com/)
Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1578
by: Deep Purple | last post by:
I started with the following error... ------------------------------------------------------- An error occured while loading the schema with TargetNamespace 'http://www.w3.org/2001/XMLSchema' referenced in this document. The value for the 'base' attribute is invalid - 'xsd:string' is an invalid value for the 'base' attribute. An error occured at the file:///C:Program Files/Microsoft Visual Studio .NET 2003...
5
3446
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS 5), but fails on IIS 6 running on a Win2003 server. The web uses Pages derived from a custom class I wrote (which itself derives from Page) to provide some common functionality. The Page_Load handler the failing webpage starts out like this: ...
10
2786
by: Chet Cromer | last post by:
I am creating a set of base classes and sub classes to use throughout a program I'm developing. The base class represents a generic "lookup table" from my database that contains lists of things like manufacturers, makes, modes, etc. of cars. I have created a generic "datacollection" class and a generic "dataobject" class to represent the table and the rows within that table as a collection of objects with generic properties for...
12
4058
by: bcr07548 | last post by:
I am writing a web site that uses JavaScript to validate certain forms and I seem to be having some trouble. The site uses PHP and for one of the forms, depending on the situation, one of of the text inputs does not exist - the PHP doesn't generate the HTML for it. I wanted to have the validation script check the length of the input if it exists but I knew that I might have trouble if I tried to check the value of the input without first...
0
676
by: dba123 | last post by:
I am getting the following error when a sub domain is receiving a shared cookie: I have this in both web.config of each application. The 1.1 application does not have the decryption= value because you cannot have that for 1.1 or asp.net will error out. The source application is coded in .NET 2.0 but the target application that's sharing the source app's cookie is a .NET 1.1 app. <machineKey...
2
9966
by: sree reddy | last post by:
..cs using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls;
3
5835
by: floppyzedolfin | last post by:
Hi there. I'm coding an encryption / decryption program. At this very moment, I think I should be pretty close from the end, but there's something blocking me on my way. There's a "Padding is invalid and cannot be removed" error raised when closing the cryptostream (or FlushFinalBlock-ing it). For what I have read, Padding errors are due to an incorrect padding : PKCS7 is recommended.
11
2591
by: batmanfreeze | last post by:
I am using C# in .Net 1.1, and need to access the 'Client' Property of TcpClient, so I created a derived class to do this based upon the Microsoft Sample, located at: http://msdn2.microsoft.com/en-us/library/system.net.sockets.tcpclient.client(VS.71).aspx The only problem is that in my main app, when I try to do the following, I get an Invalid Cast Exception: int PortNum = 10000; TcpListener objTcpListen = new...
1
3185
by: banagani | last post by:
Hi All, I am facing an issue in the XmlTextWriter class in the dotnet 2.0. This is the sample code Actual XML is like this <Name>&#x8A73;&#x7D30;&#x4ED5;&#x69D8;&#x306B;</Name>
3
3092
by: =?Utf-8?B?Vmlub2Q=?= | last post by:
Hi All, I am facing an issue in the XmlTextWriter class in the dotnet 2.0. This is the sample code Actual XML is like this <Name>詳細仕様に</Name>
0
9699
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9562
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10542
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10289
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10068
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9119
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5496
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3795
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2968
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.