using global.asax.vb for defining global parameters

Discussion in 'ASP .Net' started by OK, Nov 25, 2007.

  1. OK

    OK Guest

    I use Global.asx.vb for declaration of my global paramaters such as the
    Employee number of an Employee who logged into the website. I found this as
    the only way to handle these parameters in another aspx pages. Anyting works
    good up to now.

    In case another employee logs into the website who of course has another
    employee number while the first employee still is online, does asp.net for
    vb handle this as a session parameter or will the global parameter be
    overwritten?
     
    OK, Nov 25, 2007
    #1
    1. Advertising

  2. You really want to store this kind of user-specific stuff in Session state.
    Global static("shared") variables are "only ever one copy" - they get
    overwritten if you change them.

    --Peter
    "Inside every large program, there is a small program trying to get out."
    http://www.eggheadcafe.com
    http://petesbloggerama.blogspot.com
    http://www.blogmetafinder.com



    "OK" wrote:

    > I use Global.asx.vb for declaration of my global paramaters such as the
    > Employee number of an Employee who logged into the website. I found this as
    > the only way to handle these parameters in another aspx pages. Anyting works
    > good up to now.
    >
    > In case another employee logs into the website who of course has another
    > employee number while the first employee still is online, does asp.net for
    > vb handle this as a session parameter or will the global parameter be
    > overwritten?
    >
    >
    >
    >
    >
     
    Peter Bromberg [C# MVP], Nov 25, 2007
    #2
    1. Advertising

  3. "OK" <> wrote in message
    news:...
    >I use Global.asx.vb for declaration of my global paramaters such as the
    >Employee number of an Employee who logged into the website. I found this as
    >the only way to handle these parameters in another aspx pages. Anyting
    >works good up to now.
    >
    > In case another employee logs into the website who of course has another
    > employee number while the first employee still is online, does asp.net for
    > vb handle this as a session parameter or will the global parameter be
    > overwritten?



    For user-specific metadata which you want to cache, create it in
    Session_Start and store it in the Session object...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], Nov 25, 2007
    #3
  4. OK

    OK Guest

    Thanks Mark and Peter,

    Is there a way of defining the session variables in vb at forehand in such
    that I can refer to them as a property such as Sessionparameters.ID_employee
    rather than typing (Session("ID_employee") them?

    Oscar


    "Mark Rae [MVP]" <> schreef in bericht
    news:...
    > "OK" <> wrote in message
    > news:...
    >>I use Global.asx.vb for declaration of my global paramaters such as the
    >>Employee number of an Employee who logged into the website. I found this
    >>as the only way to handle these parameters in another aspx pages. Anyting
    >>works good up to now.
    >>
    >> In case another employee logs into the website who of course has another
    >> employee number while the first employee still is online, does asp.net
    >> for vb handle this as a session parameter or will the global parameter be
    >> overwritten?

    >
    >
    > For user-specific metadata which you want to cache, create it in
    > Session_Start and store it in the Session object...
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
     
    OK, Nov 25, 2007
    #4
  5. "OK" <> wrote in message
    news:...

    > "Mark Rae [MVP]" <> schreef in bericht
    > news:...
    >> "OK" <> wrote in message
    >> news:...
    >>>I use Global.asx.vb for declaration of my global paramaters such as the
    >>>Employee number of an Employee who logged into the website. I found this
    >>>as the only way to handle these parameters in another aspx pages. Anyting
    >>>works good up to now.
    >>>
    >>> In case another employee logs into the website who of course has another
    >>> employee number while the first employee still is online, does asp.net
    >>> for vb handle this as a session parameter or will the global parameter
    >>> be overwritten?

    >>
    >> For user-specific metadata which you want to cache, create it in
    >> Session_Start and store it in the Session object...

    >
    > Is there a way of defining the session variables in vb at forehand in such
    > that I can refer to them as a property such as
    > Sessionparameters.ID_employee rather than typing (Session("ID_employee")
    > them?


    Not natively. You could write a Session wrapper, I suppose, but I can't see
    the point...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], Nov 25, 2007
    #5
  6. Dood. Don't get hung up on the small stuff when you are just getting on first
    base.
    Later, you may be able to afford persnicketiness.
    --Peter
    "Inside every large program, there is a small program trying to get out."
    http://www.eggheadcafe.com
    http://petesbloggerama.blogspot.com
    http://www.blogmetafinder.com



    "OK" wrote:

    > Thanks Mark and Peter,
    >
    > Is there a way of defining the session variables in vb at forehand in such
    > that I can refer to them as a property such as Sessionparameters.ID_employee
    > rather than typing (Session("ID_employee") them?
    >
    > Oscar
    >
    >
    > "Mark Rae [MVP]" <> schreef in bericht
    > news:...
    > > "OK" <> wrote in message
    > > news:...
    > >>I use Global.asx.vb for declaration of my global paramaters such as the
    > >>Employee number of an Employee who logged into the website. I found this
    > >>as the only way to handle these parameters in another aspx pages. Anyting
    > >>works good up to now.
    > >>
    > >> In case another employee logs into the website who of course has another
    > >> employee number while the first employee still is online, does asp.net
    > >> for vb handle this as a session parameter or will the global parameter be
    > >> overwritten?

    > >
    > >
    > > For user-specific metadata which you want to cache, create it in
    > > Session_Start and store it in the Session object...
    > >
    > >
    > > --
    > > Mark Rae
    > > ASP.NET MVP
    > > http://www.markrae.net

    >
    >
    >
     
    Peter Bromberg [C# MVP], Nov 26, 2007
    #6
    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. =?Utf-8?B?YmNoYXJsZXM=?=

    global.asax and global.asax.cs

    =?Utf-8?B?YmNoYXJsZXM=?=, Oct 4, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    841
    =?Utf-8?B?YmNoYXJsZXM=?=
    Oct 5, 2004
  2. Replies:
    3
    Views:
    546
  3. johny smith
    Replies:
    8
    Views:
    419
    Peter Koch Larsen
    Jul 2, 2004
  4. Mark Rae

    Global.asax / Global.asax.cs in v2

    Mark Rae, May 23, 2006, in forum: ASP .Net
    Replies:
    6
    Views:
    3,165
    Mark Rae
    May 23, 2006
  5. Jack Wright
    Replies:
    0
    Views:
    161
    Jack Wright
    Feb 29, 2004
Loading...

Share This Page