Re: Question about data persistence in Public variables
- From: "Steve Mauldin" <stevemauldin@xxxxxxxxxxx>
- Date: Fri, 20 Jan 2006 15:41:52 -0600
KJ,
Thank you for the reply. I think your not following what I am stating. I am
talking about ASP.NET code. It is my understanding ASP.NET is not in itself
stateful thus when you go from one asp page to another page your variables
need to be re-addressed to memory spaces. Session and/or Cache is used to
hold information on the IIS server from page to page. You need to assign the
Session/Cache data back into a declared variable in order to access it.
That is my understanding but it is not what I am seeing.
Steps to duplicate what I am seeing.
1) create aspx page that loads data into a public variable declared in a
public module and.saves that variable into the session with the
session("X") = Variable also place a link button on page to goto page 2.
2) Create ASPX page 2 and in debug mode set break points before you start
processing this page.
3) run page 1 click on link on page and when you hit debug link on page two
check the value of the public variable. I am seeing the data stored in it
on page one without having to do an assignment statement (i.e. public
variable = session("X")). This does not seem right to me and I am wanting
to know is this by design or is this "Feature" that should not be counted on
to work the same way every time.
Thanks again.
"KJ" <n_o_s_p_a__m@xxxxxxxx> wrote in message
news:1137781097.282232.124490@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> The members of a module are implicitly marked Shared. What this means
> is that these members have the same lifetime as Shared members. A
> Shared variable has only a single lifetime, which lasts for the entire
> time your application is running.
>
.
- Follow-Ups:
- References:
- Question about data persistence in Public variables
- From: Steve Mauldin
- Re: Question about data persistence in Public variables
- From: KJ
- Question about data persistence in Public variables
- Prev by Date: Re: what's the best way
- Next by Date: Re: Changing VS2005 to generate HTML 4.01/Strict instead of XHTML 1.0
- Previous by thread: Re: Question about data persistence in Public variables
- Next by thread: Re: Question about data persistence in Public variables
- Index(es):