|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Is there anyway to treat ViewState the same as SessionState?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. 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 -- Show quoteHide quoteRegards, Alvin Bruney [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx] Got tidbits? Get it here... http://tinyurl.com/27cok "mterzich" <mterz***@discussions.microsoft.com> wrote in message news:CE3C74DB-0FB8-4732-91B1-B5C88B465D6B@microsoft.com... >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. Alvin,
Absolutely amazing. I didn't expect to get a reply but this capability is well beyond my expectations. Thanks Mike Show quoteHide quote "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 > > -- > Regards, > Alvin Bruney > [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx] > Got tidbits? Get it here... http://tinyurl.com/27cok > "mterzich" <mterz***@discussions.microsoft.com> wrote in message > news:CE3C74DB-0FB8-4732-91B1-B5C88B465D6B@microsoft.com... > >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. > > > :-)
--
Show quote
Hide quote
Regards, Alvin Bruney [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx] Got tidbits? Get it here... http://tinyurl.com/27cok "mterzich" <mterz***@discussions.microsoft.com> wrote in message
news:2D364373-C7F4-46A3-BFD9-EB350C9F0D9C@microsoft.com... > Alvin, > > 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 >> >> -- >> Regards, >> Alvin Bruney >> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx] >> Got tidbits? Get it here... http://tinyurl.com/27cok >> "mterzich" <mterz***@discussions.microsoft.com> wrote in message >> news:CE3C74DB-0FB8-4732-91B1-B5C88B465D6B@microsoft.com... >> >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. >> >> >> 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? Show quoteHide quote "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. > them to. I use tabbed browsing, and regularly have multiple pages open on out of curiousity, what is tabbed browsing?> the same web site simultaneously. -- Show quoteHide quoteRegards, Alvin Bruney [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx] Got tidbits? Get it here... http://tinyurl.com/27cok "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. > > Tabbed browsing is something supported by certain web browsers. (E.g.,
Firefox, Safari, or certain extensions for Internet Explorer.) It's where a single window can have multiple web pages open simultaneously. The usual UI for this has a tab control as the main UI area, and each tab can show one web page. Here are a couple of descriptions, the second one has a screenshot: http://www.apple.com/safari/ http://www.mozilla.org/products/firefox/tabbed-browsing.html I use this to keep related sets of web pages open in one window. I tend to have four or five web browser windows open at any one time, but many of these have three or four tabs open inside them. I find it really helpful to be able to keep all of my related browser windows grouped together, and since the Windows task bar doesn't provide any custom grouping facility, tabbed browsing is a useful way of doing this. Show quoteHide quote "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message news:OYMmYcj1EHA.2612@TK2MSFTNGP14.phx.gbl... >> 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/27cok > "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. >> >> > > very, very neat!
-- Show quoteHide quoteRegards, Alvin Bruney [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx] Got tidbits? Get it here... http://tinyurl.com/27cok "Ian Griffiths [C# MVP]" <ian-interact-sw@nospam.nospam> wrote in message news:OhmNrqr1EHA.3452@TK2MSFTNGP14.phx.gbl... > Tabbed browsing is something supported by certain web browsers. (E.g., > Firefox, Safari, or certain extensions for Internet Explorer.) It's where > a single window can have multiple web pages open simultaneously. > > The usual UI for this has a tab control as the main UI area, and each tab > can show one web page. Here are a couple of descriptions, the second one > has a screenshot: > > http://www.apple.com/safari/ > http://www.mozilla.org/products/firefox/tabbed-browsing.html > > I use this to keep related sets of web pages open in one window. I tend > to have four or five web browser windows open at any one time, but many of > these have three or four tabs open inside them. I find it really helpful > to be able to keep all of my related browser windows grouped together, and > since the Windows task bar doesn't provide any custom grouping facility, > tabbed browsing is a useful way of doing this. > > > -- > Ian Griffiths - http://www.interact-sw.co.uk/iangblog/ > DevelopMentor - http://www.develop.com/ > > "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message > news:OYMmYcj1EHA.2612@TK2MSFTNGP14.phx.gbl... >>> 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/27cok >> "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. >>> >>> >> >> > >
Other interesting topics
Copy protection for a .NET application
IP-adress of connecting peer when using remoting over HTTP in IIS can't run process how to allow only one instance of an application? How to FTP via VPN to sites on different IP's ? performing scheduled tasks in .net why GetHostByAddress gives me only computer name not actuall web hostname getting filename of OpenFileDialog How Programly create assemblyes native image How to view an icon on the taskmanager for a Windows Service |
|||||||||||||||||||||||