Re: Is there anyway to treat ViewState the same as SessionState?

From: Alvin Bruney [MVP] (vapor)
Date: 11/29/04


Date: Mon, 29 Nov 2004 13:15:55 -0400


> them to. I use tabbed browsing, and regularly have multiple pages open on
> the same web site simultaneously.
out of curiousity, what is tabbed browsing?

-- 
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27***
"Ian Griffiths [C# MVP]" <ian-interact-sw@nospam.nospam> wrote in message 
news:unQDUch1EHA.2600@TK2MSFTNGP09.phx.gbl...
> Of course you have to ask yourself what will happen when your users open 
> multiple pages into your application - there's nothing stopping a user 
> looking at more than one of your web pages at once.  What will happen to 
> your application when this happens if you're assuming that their 
> navigation will be linear?
>
> You may have disabled the back button, but that doesn't mean users will 
> necessarily follow the linear path through your application that you want 
> them to.  I use tabbed browsing, and regularly have multiple pages open on 
> the same web site simultaneously.  So although you can stop me clicking on 
> the Back button, what you can't stop me doing is following a link in a new 
> tab, navigating around in this page a bit, and then going back to the old 
> tab.
>
> So while you've disabled the Back button itself, I've recreated the 
> functionality with tabbed browsing - I can go 'back' to an older page by 
> the simple expedient of leaving that page open.
>
> Users are like this - they will find creative ways to work around it when 
> your application disables styles of navigation they want to use.
>
> One of the potential benefits of using ViewState is that it doesn't 
> actually matter when users do this - the state is maintained by the 
> browser for that page.  But if you move over to a model where you push 
> this state into the session, it's going to break if people are navigating 
> through your site creatively.
>
> If you really wanted to force people to follow a linear path through the 
> application, you could store some kind of sequence number in both the 
> session state and the viewstate, and reject requests where this doesn't 
> match.  But I wouldn't really recommend that, and for the same reason I 
> also wouldn't really recommend disabling the back button - why are you 
> constraining the user in this way?  Web sites that do this always annoy me 
> a great deal...  It's better for the user if you can avoid this sort of 
> thing.
>
> What are you doing that involves having a large enough viewstate that it's 
> causing you problems?
>
>
> -- 
> Ian Griffiths - http://www.interact-sw.co.uk/iangblog/
> DevelopMentor - http://www.develop.com/
>
> "mterzich" wrote:
>> Absolutely amazing. I didn't expect to get a reply but this capability is
>> well beyond my expectations.
>>
>> Thanks Mike
>>
>> "Alvin Bruney [MVP]" wrote:
>>
>>> this isn't built in but you can override 
>>> savepagestatetopersistencemedium
>>> and loadpagefrompersistencemedium whose default is to save it to the 
>>> view
>>> state bag. so you can add it to session there
>>>
>>> "mterzich" wrote:
>>> >I developed a web application that doesn't allow the Back Arrow on the
>>> > browser to work (disabled cacheing, always call myself on any event, 
>>> > and
>>> > code
>>> > in Load_Page that will redirect to the active page). Under this case I
>>> > will
>>> > only have the possibility of one active viewstate. Therefore the 
>>> > massive
>>> > amount of data being transfered back and forth in the viewstate hidden
>>> > attribute just causes my performance to degredate badly without any
>>> > possible
>>> > benefits. Since I can only have one possible viewstate (not multiple 
>>> > when
>>> > the
>>> > back arrow is allowed) it would be nice to have the view state treated
>>> > like
>>> > the session state (the easiest would be to place the view state in a
>>> > Session
>>> > variable that could be retrieved by the Framework anytime a post is 
>>> > done).
>>> >
>>> > Is there such a capability built into the Framework? I checked the 
>>> > @page
>>> > directive and did some searches but couldn't find any such capability.
>
> 

Loading