The Viewstate Currupted (1.0) / Base-64(1.1) Error

  • Thread starter Joao S Cardoso [MVP]
  • Start date
J

Joao S Cardoso [MVP]

Hi

I'm having a problem with a webapp that is driving me nuts. I know about the
usual viewstate errors but I think that this one is a bit diff rent. I've
searched and read on this and found that the cases documented does not applies
to me, or so it seems.

This is my problem...

I have
ASP.NET (1.0 Framework with SP2)
All latest patches installed on the server

The problem I have is diff rent behavior when running as localhost and when
running with IP on the address.

The webapp has quite a few forms and some have a reasonable sized viewstate.

If I run my webapp with:
http://localhost/myapp

It works with no problems

If I run my webapp with:
http://101.101.101.101/myapp

(101.101.101.101 is only an example of ip address)

I get "The View State is invalid for this page and might be corrupted." The
same happens for client machines (that obviously must access the server by its
IP address or domain name).

Here is the error:
================================================
The View State is invalid for this page and might be corrupted.
Description: An unhandled exception occurred during the execution of the current
web request. Please review the stack trace for more information about the error
and where it originated in the code.

Exception Details: System.Web.HttpException: The View State is invalid for this
page and might be corrupted.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can be
identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): The View State is invalid for this page and might
be corrupted.]
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +150
System.Web.UI.Page.LoadPageViewState() +16
System.Web.UI.Page.ProcessRequestMain() +421
================================================

The thing is that this same webapp is working on a VPN with multiple internal
domains with no problems.

The next thing I tried was to install 1.1 framework and see if that would solve
the problem. No luck. With 1.1 I get an "Base-64" error on viewstate.

Here is the error:
================================================
Invalid character in a Base-64 string.
Description: An unhandled exception occurred during the execution of the current
web request. Please review the stack trace for more information about the error
and where it originated in the code.

Exception Details: System.FormatException: Invalid character in a Base-64
string.

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can be
identified using the exception stack trace below.

Stack Trace:


[FormatException: Invalid character in a Base-64 string.]
System.Convert.FromBase64String(String s) +0
System.Web.UI.LosFormatter.Deserialize(String input) +24
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +101

[HttpException (0x80004005): The viewstate is invalid for this page and might be
corrupted.
================================================

I found this article for 1.0 framework:
http://support.microsoft.com/default.aspx?scid=kb;en-us;323744

but it refers to versions 1.0.3705.284 of the files and I already have
1.0.3705.288 (sp2)....

I found no reference to the Base-64 viewstate error on 1.1 version.

Any help is welcome.

best regards


Cumprimentos / Regards

Joao Cardoso (MVP dotNET)
=======================================================
Visite os grupos de discussão portugueses:
microsoft.public.pt.vsnet
microsoft.public.pt.dotnet
microsoft.public.pt.*

[LusoCoders]- http://groups.yahoo.com/group/lusocoders/
[PontoNetPT]- http://www.pontonetpt.com
(e-mail address removed)-s.p-a.m - www.acinet.pt
=======================================================
 
J

Joao S Cardoso [MVP]

After apply all patches that Microsoft sent me, including the post-sp2 ones, the
error presisted.

What I had to do was to change the viewstate management from client side to
server side.

For that, based on user session, I store the viewstate for each page up to a
maximum of x pages.

For this I inspired my implementation on the most excelent article from Robert
Boedigheimer:
(http://aspalliance.com/articleViewer.aspx?aId=72&pId=1)

This solution takes more server side memory but for now this is not a concern.
In order to save memory I will be implementing also compression of viewstate
using SharpZipLib.

The next phase will be to be able to store on diffrent formats like on session,
database or temporary file.

Hope this helps anyone with the same problem now or in the future.


Cumprimentos / Regards

Joao Cardoso (MVP dotNET)
=======================================================
Visite os grupos de discussão portugueses:
microsoft.public.pt.vsnet
microsoft.public.pt.dotnet
microsoft.public.pt.*

[LusoCoders]- http://groups.yahoo.com/group/lusocoders/
[PontoNetPT]- http://www.pontonetpt.com
(e-mail address removed)-s.p-a.m - www.acinet.pt
=======================================================
 

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

Top