Session variables and frames

Discussion in 'ASP .Net' started by =?Utf-8?B?Qm9uag==?=, Apr 20, 2004.

  1. 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.
     
    =?Utf-8?B?Qm9uag==?=, Apr 20, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:D...
    > 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.
     
    Ignacio Machin \( .NET/ C# MVP \), Apr 20, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?Qm9uag==?=

    Irbis Guest

    > 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?
     
    Irbis, Apr 20, 2004
    #3
  4. I'm going with it being undefined - i.e. can't guarantee them to be unique, can't guarantee them to be shared.
     
    =?Utf-8?B?Qm9uag==?=, Apr 21, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Powerslave2112

    From Frames to no frames?

    Powerslave2112, Jan 20, 2004, in forum: HTML
    Replies:
    2
    Views:
    596
    brucie
    Jan 20, 2004
  2. Philip
    Replies:
    3
    Views:
    976
    Karl Groves
    Jun 28, 2004
  3. Ale

    Frames or not Frames...

    Ale, Aug 3, 2005, in forum: HTML
    Replies:
    17
    Views:
    965
    Adrienne
    Aug 5, 2005
  4. Replies:
    1
    Views:
    1,001
    dorayme
    Feb 10, 2006
  5. A Web Master
    Replies:
    4
    Views:
    162
    Evertjan.
    Jan 23, 2004
Loading...

Share This Page