Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Session variables and frames

Reply
Thread Tools

Session variables and frames

 
 
=?Utf-8?B?Qm9uag==?=
Guest
Posts: n/a
 
      04-20-2004
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.
 
Reply With Quote
 
 
 
 
Ignacio Machin \( .NET/ C# MVP \)
Guest
Posts: n/a
 
      04-20-2004
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" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> 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
between the <%= ... %> comes to read it?
>
> Thanks for any help, would really appreciate this one clearing up!
>
> Thanks.



 
Reply With Quote
 
 
 
 
Irbis
Guest
Posts: n/a
 
      04-20-2004
> 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


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?
 
Reply With Quote
 
=?Utf-8?B?Qm9uag==?=
Guest
Posts: n/a
 
      04-21-2004
I'm going with it being undefined - i.e. can't guarantee them to be unique, can't guarantee them to be shared.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Put variables into member variables or function variables? tjumail@gmail.com C++ 9 03-23-2008 04:03 PM
Session Variables and Static Variables cobus.lombard@gmail.com ASP .Net 1 03-26-2006 11:05 AM
Frames and borders around specific frames meyousikmann@yahoo.com HTML 1 02-10-2006 11:12 PM
Link needed to go from a non-frames page to a Frames page, and load a particular frame. How? - Newbe Philip HTML 3 06-28-2004 03:06 PM
Netscape : ASP Session variables across frames not accessible ? A Web Master ASP General 4 01-23-2004 08:59 PM



Advertisments