[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

Invalidad View State error on Pocket PC

Ricardo TIneo

6/29/2002 1:29:00 AM

I tried this... even though it keeps the view state in the
object session, load and shows the information of the
controls, it does not work of suitable way...
override this methods in my page.. and put a button with a
line of code:

Label1.Text="hello"

my page was loaded with a datagrid.. when the page
refresh.. the information in datagrid is show, but the
change in the control label not show... whats happen???

From: "Craig Deelsnyder" <cdeelsny@yahoo.com> Sent:
4/10/2002 1:09:39 PM




It's not different, it's that the view state by default is
stored via a
hidden field in the form. The problem is the there's a
smaller limit on the
size of hidden fields on the PocketPC, and most times you
hit it if you
don't tweak your aspx pages.

You need to store the view state some other way. I do it
for now using
Session variables. Here's the two methods to override to
define this:

Protected Overrides Sub SavePageStateToPersistenceMedium
(ByVal viewState As
Object)
Session("MyViewState") = viewState
End Sub

Protected Overrides Function
LoadPageStateFromPersistenceMedium() As Object
Return Session("MyViewState")
End Function

Override these in every page (this is where inheritance
comes in real handy)
and it should work. I have no problems with it so far,
even with multiple
windows, etc., but you may want to find a different way to
store. Another
way I've seen is using a LosFormatter object to serialize
and save the view
state object (which is really a Triplet) as a String
(which is pry what
happens by default) in some other way.

Search for these buzz words in www.deja.com and you'll
find examples if the
Session way doesn't fit your needs.



"Vladimir Lvov" <lvov@_DELETE_IT_wrapmation.com> wrote in
message
news:eQzKLbM4BHA.2652@tkmsftngp05...
> What is the difference in View State management on a
Pocket PC and a
desktop
> PC?
>
> I have an ASP.Net application that saves a small dataset
(1 record) using
> the ViewState. It runs without any problem on any
desktop PC but crashes
on
> Pocket PC. The message is
> "The View State is invalid for this page and might be
corrupted."
>
> Thanks,
> Vladimir
>
>
>