Session variables and frames

G

Guest

H
I've got the following problem - I need to have an aspx page with two frames, although the question isn't necessarily about the workings of the frames, more session variables... the frames consist of one header (not resizable) and one main (resizable). The source for the "main" page needs to be of the form "WebForm3.aspx?...." with parameters to be determined at runtime. I'm ok with this, I've gone down the route of puttin
src="<%= MainPageToDisplay %>

but what about MainPageToDisplay - the info it needs to access can only be decided in the Page_Load event - so I was wondering which out of a global variable and a session variable are the most reliable to store this information, for instance my dilemma is as such
If I use a global variable, will it be guaranteed to have a unique value in the memory of the web server for each user
If I use a session variable, will it be reliable enough to be guaranteed not to have been "relegated out of the session" by the time the property between the <%= ... %> comes to read it

Thanks for any help, would really appreciate this one clearing up

Thanks.
 
I

Ignacio Machin \( .NET/ C# MVP \)

hi Bonj,

You are confusing server side and client side, the Page_Load event occur in
the server side, the objects from the client side (frames, documents,
windows, etc ) do not exist.

If your header page decide the content of the main page you need to
implement that functionality there, you can do so in different ways, if the
page to load & its parameters are decided in the server, then you have to
send this info back to the browser, where a script can read it and set the
correct src of the main frame. the other way to do it is if when you load
the header you can decide what the possible source of main page will be you
can use LinkButtons for example with the correct properties value set.

regarding your doubs about global/session variables:
If I use a global variable, will it be guaranteed to have a unique value
in the memory of the web server for each user?
there are not global variables, they need to be either in
Session/Application collections or as a static member of a class used, in
anyway its value will be shared among ALL the users of the application
If I use a session variable, will it be reliable enough to be guaranteed
not to have been "relegated out of the session" by the time the property
between the <%= ... %> comes to read >it?

A session variable will exist as long as the session exist, it will never
happen that a variable exist when you start processing the page and timeout
before you finish processing it, the only way to end a session is either you
call Session.Abandon or a page is not requested in a given timeframe.



Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Bonj said:
Hi
I've got the following problem - I need to have an aspx page with two
frames, although the question isn't necessarily about the workings of the
frames, more session variables... the frames consist of one header (not
resizable) and one main (resizable). The source for the "main" page needs to
be of the form "WebForm3.aspx?...." with parameters to be determined at
runtime. I'm ok with this, I've gone down the route of putting
src="<%= MainPageToDisplay %>"

but what about MainPageToDisplay - the info it needs to access can only be
decided in the Page_Load event - so I was wondering which out of a global
variable and a session variable are the most reliable to store this
information, for instance my dilemma is as such:
If I use a global variable, will it be guaranteed to have a unique value
in the memory of the web server for each user?
If I use a session variable, will it be reliable enough to be guaranteed
not to have been "relegated out of the session" by the time the property
 
I

Irbis

regarding your doubs about global/session variables:
in the memory of the web server for each user?
there are not global variables, they need to be either in
Session/Application collections or as a static member of a class used, in
anyway its value will be shared among ALL the users of the application

Are the class member declared as static shared among ALL the users of
the application?

As far as I understand objects declared in a session scope shouldn't
be shared among ALL users.

Where can I read more info about it?
What should I do to declare and initialize object once per user and
this object shouldn't be shared among other users?
 
G

Guest

I'm going with it being undefined - i.e. can't guarantee them to be unique, can't guarantee them to be shared.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top