Re: Properties instead of Session Variables

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Everything is BAAAAD... Even life itself considered to be a lethal
disease.... :)
So unless you work on second google.com you can use Session...

And totally do not see what is wrong with Application... just make sure you
know what you doing and do not put open DB connection in there....

PS: File is bad... hard to make it work in multi-user environment

George.

"Lucy" <Lucy@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D7DA9F18-3742-4078-A5A5-2BA62AAE3935@xxxxxxxxxxxxxxxx
Application and Session vars. are BAAAAAD practice.
Use cookies, viewstate (for user), file, or DB (Globally )
-L

"Stan" wrote:

On 6 Apr, 15:07, Patrice <patrice_scr...@xxxxxxxxxxx> wrote:
Globally that is ? For a particular user (in which case i don't see
why you couldn't use session variables) or for all users (in which
case you could use application variables) ?

Keep in mind that http is stateless that is server side stuff is
created from zero with each new request. So you can't create something
server side and expect it to be available in the during the next round
trip without having this stored in a preserved location (pages are
usually using the viewstate that is an hidden field that is posted
with each new request to recreate the page in its previous state).

I'd forgotten about the Application state, thanks Patrice for the
reminder (I've never used it).

To share the myfile object globally, assign it as:

Application("myfile") = myfile.

However there remains the problem of who owns it and is allowed to
overwrite it etc.



.



Relevant Pages

  • Re: ViewState: why?
    ... the property, the user clicks a button, and there is another request to the ... and each request to the server means a new ... The ViewState approach works, because the viewstate is posted back to the ... > public string Text ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ViewState: why?
    ... If you don't store the value in the viewstate, ... lost (since each request instanciate a new webform object), ... one of the servers to act as a state server, or you can use SQL Server. ... My opinion is that the viewstate should be use as soon as you have a value ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Properties instead of Session Variables
    ... Application and Session vars. ... Use cookies, viewstate, file, or DB ... with each new request to recreate the page in its previous state). ...
    (microsoft.public.dotnet.framework.aspnet)
  • Viewstate - load balance web site - Losing state
    ... our viewstate gets "lost" between requests. ... Everytime the request move from one server to the other the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Viewstate - load balance web site - Losing state
    ... One server had 1.1 Service Pack 1 installed and the other did not. ... a non-communicated update by the network team overnight. ... previous requests viewstate. ... Everytime the request move from one server to the other the ...
    (microsoft.public.dotnet.framework.aspnet)